:w !sudo tee % Save a file you edited in vim without the needed permissions
--- cat ~/.ssh/id_rsa.pub
|ssh user@server "cat >> .ssh/authorized_keys"|
in 'screen', to save a copy of the scrollback buffer:
ctrl-a ctrl-+ to get to command mode, then
hardcopy -h <filename>
btw why do i use screen rather than tmux? tmux had problems with using the middle button to paste, over ssh
screen -X -S [session # you want to kill] kill
sudo ln -s /etc/resolvconf/run/resolv.conf
make any website editable
rotate and play a video:
mplayer -vf rotate=2 /tmp/p8253012.avi -vo x11 -ao none -framedrop -nobps -ni -forceidx -mc 0 -vfm ffmpeg -lavdopts fast:skiploopfilter=all
--- strip audio from a video:
ffmpeg -i MVI_0047.AVI -an -vcodec copy /tmp/MVI_0047.AVI
how to increase brightness, hue on videos? the following works but is too big and can't be played on xine
mencoder -o /tmp/test.avi -oac copy -ovc raw -vf eq2=1:1:-0.06:1.20 clouds/090802/p8021536.avi
to test and then deploy djangoappengine projects:
./manage.py runserver ./manage.py deploy
When changing email addresses, use mairix, mutt, and a standing emacs session to quickly, semiautomatedly send email to some people who have emailed my old address in the last six months:
put in .mairixrc:
base=~/Mail maildir=... mfolder=~/mairixResults database=~/Mail/mairix_database
initialize mairix database:
create a search folder containing every message sent to my old email address by someone other than myself in the last six months:
mairix d:6m- t:firstname.lastname@example.org f:~email@example.com
(replace firstname.lastname@example.org and email@example.com with real addresses)
put in .muttrc:
macro index <F12> "<reply>^M^Unew email: firstname.lastname@example.org^Mny"
(replace email@example.com with the real address)
also, make sure that your sent mail is being saved in .muttrc, with something like:
set record= =sent-mail
in emacs, type something like this into any buffer, then kill it (and yank it, if you want):
My current email address is now
You are receiving this automated email because you have recently sent an email to my old email address, firstname.lastname@example.org, which will stop working soon -- please update your address book. Thanks, bayle
restart mutt. change to folder ~/Mail/mairixResults. go down the list until you find someone to whom you'd like to send an update, making sure their message is highlighted. hit F12. this starts a reply to the highlighted message with the subject heading as in the F12 macro definition above. now you land in emacs to type the body of the message. press F3 (begin macro definition). Yank the text of the message. Kill the buffer. You return to mutt, and the mutt macro completes execution by automatically sending the message.
Go down the list until you find someone else you wish to notify. This time, in emacs, just press F4 twice. The first press ends the macro defn, the second press executes the macro (which now includes yanking the text and closing the buffer).
For subsequent notifications, just press F4 (sometimes that didn't work for me and i had to press it twice for some reason).
Be careful not to highlight or copy or kill any text while you're doing this, or emacs might start yanking that into your outgoing message body rather than the text that you want. i'd check your sent-mail after sending the first message to make sure it went out OK (or even send the first one to yourself by sending yourself a test message, highlighting it in Mutt when your receive it, and pressing F12). I'd check sent-mail again when you are done to make sure the rest went out ok.
SOME_VARIABLE.public_methods - Object.public_methods
screen -X hardcopy -h /tmp/t