After stopped the spam, I need to clear the spam queue in exim [code lang=”shell”] exim -bp | awk ‘/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}’ | bash [/code]
Category Archives: Linux
Remove WordPress Malware using Linux Shell Console
exit code of #128 fatal: unable to connect to github.com
I follow the Quickstart guide from FoundationPress and it display this error [code lang=”bash”] bower install && grunt build bower foundation#* not-cached git://github.com/zurb/bower-foundation.git#* bower foundation#* resolve git://github.com/zurb/bower-foundation.git#* bower fontawesome#~4.3.0 not-cached git://github.com/FortAwesome/Font-Awesome.git#~4.3.0 bower fontawesome#~4.3.0 resolve git://github.com/FortAwesome/Font-Awesome.git#~4.3.0 bower fontawesome#~4.3.0 ECMDERR Failed to execute “git ls-remote –tags –heads git://github.com/FortAwesome/Font-Awesome.git”, exit code of #128 fatal: unable to connect to Continue reading “exit code of #128 fatal: unable to connect to github.com”
Finding all files containing a text string on Linux or Mac
I need to find some string in all folders. [code lang=”bash”] grep -rnw ‘./folder/’ -e “search-text” [/code] Note: -r is recursive -n is line number -w stands match the whole word
Fastest way to rename filenames with space to dash in linux
I want to mass rename hundred of filenames like filename 001.jpg to filename-001.jpg … … … filename 099.jpg to filename-099.jpg I use this command to rename all in few seconds in my MacBook Pro. I think it is fine to run in any linux. [code lang=”bash”] for f in *\ *; do mv "$f" "${f// Continue reading “Fastest way to rename filenames with space to dash in linux”
Show Image Size in Terminal or Shell
The easiest way to show the file size in Terminal in Mac or Linux. [code lang=”bash”] ustins-MacBook-Pro:jpg juzhax$ file 001.jpg 001.jpg: JPEG image data, EXIF standard Justins-MacBook-Pro:jpg juzhax$ identify 001.jpg 001.jpg JPEG 720×468 720×468+0+0 8-bit sRGB 59.8KB 0.000u 0:00.009 Justins-MacBook-Pro:jpg juzhax$ [/code]
command c expects followed by text error in Mac
You received error from the sed command in Mac, because the argument in mac is different. If you type in Mac terminal, you may receive error like this [code lang=”bash”] Justins-MacBook-Pro:2 juzhax$ sed -i ‘s/old_text/new_text/g’ example.txt sed: 1: "config.php": command c expects \ followed by text [/code] The first argument should be the extension of Continue reading “command c expects followed by text error in Mac”
Hacker’s Secret 100 Secret Techniques Revealed
One of the nice book that suitable for Hacker, but too bad it is in Japanese version. Wish someone will translate to English version in future. You can find the author from here Satoru Takabayashi, Fumitoshi Ukai, Yusuke Sato, Shinichiro Hamaji, Kazuyuki Shudo Chapter 1. Introduction 1. Introduction to Binary Hacks 2. Terminology of Binary Hacks 3. Using “file” to Continue reading “Hacker’s Secret 100 Secret Techniques Revealed”
use tcpdump to trace POST data in linux
[code lang=”bash”] tcpdump -s 0 -A ‘tcp dst port 80 and (tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354)’ [/code]
Remove ^M with VIM in linux
How I do to replace this with a ‘normal’ line break? Replace ^M to normal line break in many config files. [code lang=”bash”] :%s/<ctrl -V></ctrl><ctrl -M>//g </ctrl> [/code]
