Skip to content

Instantly share code, notes, and snippets.

View TerryFunggg's full-sized avatar
🛌
writing dummy code

Terry Funggg TerryFunggg

🛌
writing dummy code
View GitHub Profile
@TerryFunggg
TerryFunggg / global_search_line.sh
Last active April 8, 2021 04:52
Find specific text by given directory in linux
grep -Ril "text-want-to-find" <directory>
# -i for ignore case
# -R for recursive
# -l for show the file name
# Example:
# In my case, I forgot the location of my mirrors config
# but I remember what mirrors i used
grep -Ril "aliyun" /etc
@TerryFunggg
TerryFunggg / encode_email_address.sh
Last active January 16, 2021 04:48
encode your email address, very cool
# encode
echo youremail@eample.com | base64
# decode
echo BASE64_CODE | base64 -d
@TerryFunggg
TerryFunggg / high_process_.sh
Last active January 16, 2021 04:55
Linux command for finding high CPU consumption process
ps -eo pid,ppid,%mem,%cpu,comm --sort=-%cpu | head
# Result :
#
# PID PPID %MEM %CPU COMMAND
# 948934 948837 2.9 44.4 spotify
# 948781 1 2.9 27.5 spotify
# 948876 948836 1.5 9.2 spotify
# 80755 1 7.5 5.3 firefox
# 948919 948781 1.1 3.6 spotify