To save iptables firewall rules, run
iptables-save
This will print the firewal rule. You can save it to a file. For example
iptables-save > /etc/iptables/rules.v4
For IPv6, you can use
ip6tables-save
To save iptables firewall rules, run
iptables-save
This will print the firewal rule. You can save it to a file. For example
iptables-save > /etc/iptables/rules.v4
For IPv6, you can use
ip6tables-save
To run xinetd in forground in debug mode, run
/usr/sbin/xinetd -d -dontfork
On linux, the file /proc/PID/cmdline shows the command line for the process. If you check content of this file, you will see the command, but arguments are not seperated by space.
To display the command line with space, run
cat /proc/PID/cmdline | tr '\000' ' '
Or
cat /proc/PID/cmdline | xargs -0 echo
Example
To display environ file, run
cat environ | xargs -0 -L1 echo
When running apt-key command, i get following error.
root@ip-172-31-46-9:~# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
Executing: /tmp/apt-key-gpghome.MYmMoDt7Sv/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
gpg: failed to start the dirmngr '/usr/bin/dirmngr': No such file or directory
gpg: connecting dirmngr at '/run/user/0/gnupg/d.ar6ctd7ngpsiegqaseo7cgyr/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
root@ip-172-31-46-9:~#
To fix this, run
apt install dirmngr
You can see detailed instruction on how to install on MongoDB web site.
First add key
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
For Debian 8, run
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/4.0 main" > /etc/apt/sources.list.d/mongodb-org-4.0.list
For Debian 9, run
echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.0 main" > /etc/apt/sources.list.d/mongodb-org-4.0.list
Now install mongoDB with
apt-get update apt-get install -y mongodb-org
Once installed, you can check version with
root@ip-172-31-25-155:~# mongod --version db version v4.0.4 git version: f288a3bdf201007f3693c58e140056adf8b04839 OpenSSL version: OpenSSL 1.1.0f 25 May 2017 allocator: tcmalloc modules: none build environment: distmod: debian92 distarch: x86_64 target_arch: x86_64 root@ip-172-31-25-155:~#
Enable MongoDB start on boot
systemctl enable mongod
To start/stop mongodb
systemctl start mongod systemctl stop mongod
On a CentOS server, when running
yum update
It failed with following error
acl-2.2.51-14.el7.x86_64 is a duplicate with acl-2.2.51-12.el7.x86_64 alt-libcurlssl-7.60.0-1.el7.x86_64 is a duplicate with alt-libcurlssl-7.54.0-8.el7.cloudlinux.x86_64 alt-php-config-1-29.1.el7.noarch is a duplicate with alt-php-config-1-27.el7.noarch alt-php44-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-4.4.9-81.el7.x86_64 alt-php44-bcmath-4.4.9-88.el7.x86_64 is a duplicate with alt-php44-bcmath-4.4.9-81.el7.x86_64
https://gist.github.com/serverok/c0853120baff8848054cfb598e389c3a
This is because previous “yum update” failed for some reason after package install. So no cleanup was done.
To fix, you need to use package-cleanup command.
yum install yum-utils
To list all duplicate packages, run
package-cleanup --dupes
To remove all duplicate packages, run
package-cleanup --cleandupes
Now do a yum update
yum update
This will update your system and install any missing packages.
To verify if there any problem, run
package-cleanup --problems
If this does not fix, try yum fix duplicate package error
See yum
Here is an example POST request using curl
curl -d "param1=value1¶m2=value2" -X POST http://sok.test/post.php
Sending JSON string
curl http://video.com/like -X POST --data '{"like":"1","media_id":"781","time_start":"100:36:19.584"}'
Post a variable
curl URL_HERE -X POST --data 'badSSN=111111111'
To check hard disk, run
fsck.ext4 /dev/sda1
Auto Repair file system
By default fsck will ask you what to do when it find any error. When you have many errors, pressing y for each error is time consuming. It is better use -a or -y option for auto repair.
fsck -y /dev/sda1
Install Paid SSL on Centova Cast
Install LetsEncrypt Free SSL on Centova Cast
CentovaCast Enable SSL on icecast
CentovaCast Enable SSL for shoutcast
Manually run icecast on CentovaCast server
Upgrade CentovaCast
CentovaCast change MySQL password
mp3 files stored in folder
/usr/local/centovacast/var/vhosts/USER/var/spool/media/
Login url
http://IP_ADDR_OR_DOMAIN:2199
When user connect with FTP, he will see files from folder /usr/local/centovacast/var/vhosts/USER/var/spool/
ISPConfig 3 configuration files are are located in folder
/usr/local/ispconfig/interface/lib/config.inc.php /usr/local/ispconfig/server/lib/config.inc.php /usr/local/ispconfig/server/lib/mysql_clientdb.conf
DocumentRoot
/usr/local/ispconfig/interface/web/
Config file for webmail/phpmyadmin
/etc/nginx/sites-available/000-apps.vhost
Config for ispconfig web interface
/etc/nginx/sites-available/ispconfig.vhost