My collection of bash one-liners to be used as reference to write more complex scripts.
This file contains 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
/* Selectors */ | |
$("button"); // by tag name | |
$(".animated"); // by class name | |
$("#button3"); // by ID | |
$("someselector:nth-child(2)"); | |
/* CSS */ | |
$(selector).addClass("someclass"); | |
$(selector).removeClass("someclass"); | |
$(selector).css("color", "blue"); |
This file contains 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
wget https://download.samba.org/pub/rsync/rsync-3.1.2.tar.gz | |
wget https://download.samba.org/pub/rsync/rsync-patches-3.1.2.tar.gz | |
tar xzvf rsync-3.1.2.tar.gz | |
tar xzvf rsync-patches-3.1.2.tar.gz | |
cd rsync-3.1.2/ | |
patch -p1 <patches/detect-renamed.diff |
AWS Snippets
This file contains 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
-Djava.io.tmpdir=/home/user/temp |
This file contains 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
#!/bin/bash | |
if [ "$EUID" -ne "0" ] | |
then | |
echo "This script must be run as root." | |
exit 1 | |
fi | |
echo EHC1 > /proc/acpi/wakeup | |
echo EHC2 > /proc/acpi/wakeup |
This file contains 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
#!/bin/bash | |
xfconf-query -c xfce4-session -p /shutdown/ShowSuspend --create --set true --type bool | |
xfconf-query -c xfce4-session -p /shutdown/ShowHibernate --create --set false --type bool |
This file contains 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
#!/bin/bash | |
echo net.ipv6.conf.all.disable_ipv6 = 1 | sudo tee /etc/sysctl.d/99-disable-ipv6.conf | |
sudo sysctl --system |
This file contains 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
#!/bin/bash | |
find $1 -type f -print0 | \ | |
xargs -0 md5sum | \ | |
awk '{r = gensub( "([a-f0-9]+) (.+/)(.+)(\\..+)", "\\2\\3\\4 \\2\\1\\4", "g") ; print r ; }' | \ | |
xargs -L1 mv -v |
This file contains 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
#!/bin/bash | |
openssl s_client -connect 127.0.0.1:443 -ssl3 |
OlderNewer