This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*StR1*' -type f -exec bash -c 'mv "$1" "${1/StR1/StR2}"' -- {} \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum -y install net-snmp net-snmp-utils | |
firewall-cmd --zone=public --permanent --add-port=161/tcp | |
firewall-cmd --zone=public --permanent --add-port=161/udp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE | |
table_name | |
SET | |
column_name = REPLACE(column_name, 'text to find', 'text to replace with') | |
WHERE | |
column_name LIKE '%text to find%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE prods | |
INNER JOIN cat_key ON (prods.cat = cat_key.name) | |
SET prods.cat = cat_key.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -- sh -c 'ifdown eth0 ; modprobe -r vmxnet3; modprobe vmxnet3 ; ifup eth0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket,struct | |
def makeMask(n): | |
"return a mask of n bits as a long integer" | |
return (2L<<n-1) - 1 | |
def dottedQuadToNum(ip): | |
"convert decimal dotted quad string to long integer" | |
return struct.unpack('L',socket.inet_aton(ip))[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. You should upgrade CURL | |
2. you better upgrade ca-certificates | |
3. install epel-release | |
4. install epel package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scp user@host:/path/to/directory\\\ with\\\ spaces/file ~/Downloads | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pgrep -cx rsync || sshpass -p 'P@SSW0RD' rsync -avzP -e "ssh -p 4532" root@HOSTNAME:/var/www/dataroot/html/media /var/www/html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Resize the partition (again, you can do this with the system running). GParted is easy to use and supports resizing. | |
You can also use a lower level tool such as fdisk. But you'll have to delete the partition and recreate it. Just make sure when doing so that the new partition starts at the exact same location. | |
2. partprobe or Reboot. Since the partition table was modified on the running system, it won't take effect until a reboot. | |
3. Run pvresize /dev/sdXY to have LVM pick up the new space. | |
4. Resize the logical volume with lvextend. If you want to use the whole thing, lvextend -r -l +100%FREE /dev/VGNAME/LVNAME. The -r will resize the filesystem as well. | |
Though I always recommend against using the entire volume group. You never know what you'll need in the future. You can always expand later, you can't shrink. |