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
Novell SuSE | |
/etc/SuSE-release | |
Red Hat | |
/etc/redhat-release, /etc/redhat_version | |
Fedora | |
/etc/fedora-release | |
Slackware |
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
#!/bin/bash | |
rename -vs | |
# usage: | |
# rename oldfilename newfilename *filepattern | |
# example: | |
# rename files in present directory ending with .htm to .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
### mpstat command ### | |
# all cpu utilization | |
mpstat -A | |
# processor utilization by CPU | |
mpstat -P 0 | |
mpstat -P 1 | |
# gather multiple reports over time |
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
#!/bin/bash | |
# These commands test if the system is 64-bit. If not, a warning message in red is displayed, if it is 64-bit, x86_64 is displayed | |
[ 64 -eq $(arch | cut -c 5-) ] && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" | |
[ 64=="$(arch | cut -c 5-)" ] && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" | |
# Here is a new one, inspired by a post in this thread: | |
# http://unix.stackexchange.com/questions/12453/how-to-determine-linux-kernel-architecture | |
((1<<32)) && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" |
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
#!/bin/bash | |
# | |
Ctrl + A Go to the beginning of the line you are currently typing on | |
Ctrl + E Go to the end of the line you are currently typing on | |
Ctrl + L Clears the Screen, similar to the clear command | |
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. | |
Ctrl + H Same as backspace | |
Ctrl + R Let’s you search through previously used commands | |
Ctrl + C Kill whatever you are running | |
Ctrl + D Exit the current shell |
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
################# | |
# ENTERTAINMENT # | |
# free movies on youtube | |
https://www.openculture.com/freemoviesonline | |
http://www.openculture.com/freeaudiobooks | |
https://www.openculture.com/free_textbooks | |
############## | |
# ENCRYPTION # |
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
#!/bin/bash | |
# rough function of http://blog.commandlinekungfu.com/2014/06/episode-179-check-is-in-mail.html | |
check_CertExpire() { | |
for d in "$@"; do | |
echo -ne $d\\t; | |
[[ $(( $(date +%s -d "$(echo | openssl s_client -connect www.$d:443 2>/dev/null | | |
openssl x509 -noout -dates | tail -1 | cut -f2 -d=)") - $(date +%s) )) |
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
# finds all executable files in a sub-directory - casts a wide net | |
find /mydir/mysubdir -executable -type f | |
# find all duplicates in sub-directories - slooow | |
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w64 --all-repeated=separate | |
# find dupes while excluding .svn | |
find -type d -name ".svn" -prune -o -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type d -name ".svn" -prune -o -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w64 --all-repeated=separate | |
# faster dupe finder (removes 2nd find loop) | |
find -not -empty -type f -printf "%-30s'\t\"%h/%f\"\n" | sort -rn -t$'\t' | uniq -w30 -D | cut -f 2 -d $'\t' | xargs md5sum | sort | uniq -w32 --all-repeated=separate |
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
# limit Firefox connections/downloads to 8 | |
# change values below in about:config | |
network.http.max-persistent-connections-per-server | |
network.http.max-persistent-connections-per-proxy |