fallocate -l 1G /mnt/1GB.swap
mkswap /mnt/1GB.swap
swapon /mnt/1GB.swap
Monthly Archives: November 2015
linux fill swap memory
stress --vm-bytes $(awk '/MemFree/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1
linux check csr
openssl req -in some.csr -noout -text
linux monitor network activity
ethtool -S eth0
Also many information you can find there: ls /sys/class/net/eth0/statistics/
or maybe deprecated: netstat -s
linux delete hard links of some file
Yes its safe, because hard links are only pointers to the same innode number.
linux check if folder is local file system
df -P -T /some/path/address | tail -n +2 | awk ‘{print $2}
gmail server ip addresses
nslookup -q=TXT _netblocks.google.com 8.8.8.8
nslookup -q=TXT _netblocks.google.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
_netblocks.google.com text = “v=spf1 ip4:64.18.0.0/20 ip4:64.233.160.0/19 ip4:66.102.0.0/20 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:74.125.0.0/16 ip4:108.177.8.0/21 ip4:173.194.0.0/16 ip4:207.126.144.0/20 ip4:209.85.128.0/17 ip4:216.58.192.0/19 ip4:216.239.32.0/19 ~all”
linux find hard linked files
find . -samefile /tmp/some_file
linux find files in several folders
find `pwd` /tmp -type f -print
linux find more than one (hard) link
Find linux hard linked files at current folder:
find . -type f -printf '%n %p\n' | awk '$1 > 1 {$1="";print}'
iftoprc
vi /root/.iftoprc
# .iftoprc
# config file for iftop
dns-resolution: no
port-resolution: no
show-bars: yes
promiscuous: yes
port-display: on
hide-source: no
hide-destination: no
use-bytes: yes
line-display: one-line-both
show-totals: yes
log-scale: ye
logging iptables packets with ulogd
sudo apt-get install ulogd
If you want log dropped packets, lets do this:
-A INPUT -p tcp -m tcp –tcp-flags FIN,SYN,RST,ACK SYN -j ULOG
-A INPUT -p tcp -m tcp –tcp-flags FIN,SYN,RST,ACK SYN -j DROP
(13)Permission denied: /www/website.com/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www.website.com/
You need check directory permissions of /www/website.com or /www/ folder.
chmod 755 /www/website.com
syssnap create system snaphsot of all process
Helpful utility for system performance monitoring and troubleshooting server load issues, this tools was offered by cPanel support team.
cloudlinux install composer globaly for all users
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
vi /etc/cagefs/conf.d/composer.cfg
[composer]
comment=Composer
paths=/usr/local/bin/composer
cagefsctl --force-update