Translate FailsBlogrollCreative Commons |
Thursday, February 14. 2013Deshake/stabilize videos with transcode - the simple wayIf I ever need to stabilize any video again - two pass stabilization with transcode (alter arguments to your needs, of course): transcode -H0 -g 960x540 -J stabilize -i inputfile.mp4 -x mplayer,mplayer -y null,null -o dummy
transcode -H0 -g 960x540 -J transform -i inputfile.mp4 -x mplayer -y xvid -o outputfile.mp4 Compress mp4 videos with ffmpeg - the simple wayNext time I need to compress a bunch of HD videos recorded with a smartphone: for i in *.mp4 ; do ffmpeg -i "$i" -c:a copy -preset medium "${i%.*}_medium.${i##*.}"; done
Downscale a video to half its actual width: ffmpeg -i inputfile.mp4 -c:a copy -vf scale=iw/2:-1 outputfile.mp4
Or scale using absolute sizes (using different notation): ffmpeg -i inputfile.mp4 -filter:v scale=720:-1 -acodec copy outputfile.mp4
Scale to width of 720 pixel with an even height for libx264 encoding support (odd dimension values are not supported for encoding with libx264): for i in *.mp4; do ffmpeg -i "$i" -c:a copy -vf scale="720:trunc(ow/a/2)*2" -preset medium "${i%.*}_720.${i##*.}"; done
Tuesday, March 20. 2012Switch CapsLock and Alt - use physical Alt key as notion/ion3 METAIf your keyboard lacks the “Flying windows” key which you could use as the Meta key for one of the better window managers “notion”, this solution might be interesting for you. I find it very comfortable to use the physical left Alt key as META key for notion. The “flying windows” key would also be fine, but it is not available on my IBM keyboards. For years I was fine with using Alt as META and escaping Alt-Combinations in notion with META+k-q to pass them through to an applications/xclient. Some day I decided to be able to send Alt signal without the need to escape it in notion. The idea to achieve it is: • make physical CapsLock send Alt signal • make physical Alt_L to send Super_L signal • assign switched key symbols to modifiers • make notion use the modifier with Super_L as META key At starting point the modifier map looks like this:
Find out what keycodes physical Alt and CapsLock keys are assigned toFirstly find out to which keycodes your physical Alt and CapsLock are mapped. Run xev to find out. According to xev, on my machine CapsLock key uses the keycode 66. The physical left Alt key uses the keycode 64. Recheck with xmodmap:
Your output might differ depending on your configuration or hardware. Currently my Caps key is mapped to switch the keyboard layout, thus “ISO_Next_Group” appears in the output. [offtopic] If you're curious, it results from
[/offtopic] Remap physical Alt and CapsLock keysRemap CapsLock keysymAdd xmodmap entries to ~/.Xmodmap to clear the CapsLock:
Clear mod1 and mod4Append further xmodmap entries:
Assign physical Caps key to Alt_L symbolSince Caps key uses the keycode 66, assign the keysym Super_L to it with the next xmodmap entry:
Assign physical left Alt to Super_L symbol
Assign modifiers
Result
Now META can be set to “Mod4+” in ~/.notion/cfg_notion.lua. Physical Alt key will be notion's META key and CapsLock acts as Alt without the need to be escaped. It is important that you call xmodmap ~/.Xmodmap while starting your xsession after your setxkbmap command eg. in xinitrc script like:
Since Caps is now actually an Alt, I use pressing both Shift keys to toggle the keyboard layout. Wednesday, February 1. 2012Screen-like tmux: Attach a tmux session from multiple clients and view different windows per clientIf using terminal multiplexer screen, one can easily attach a session which is not detached with
That way it is possible to attach the same session to multiple clients. By default you are able to view different screen windows per client which attached that session. In tmux the default behavior differs. Though you can also attach the same tmux session to multiple clients e.g. with
it will let you view the same tmux window in all clients that attached that tmux session. When tmux instance starts it creates automatically one tmux session. Such a session is presented equally to every client. Create independend tmux sessions for the same window setA user creates a new tmux session with
The user decides to work with the same window set in another terminal independend:
That creates a new session which uses the same window set as group 0 listed above and attaches clientB to it. Two independent sessions working on the same set of windows are running. Very close to screen behavior. Output of tmux list-sessions looks now like:
While attached to a tmux session tmux lets you change your session interactively with <C-b s>. Closing sessions is done e.g. by
Friday, January 27. 2012Setup the environment depending on the host the user logins fromJust spent about 20 minutes to answer a question on stackoverflow and as I was ready to commit it, the question got already closed. It would be a pity to throw the answer away, so i'll paste it here. Hi there. You could script around the outputs of who. $who
jham pts/13 2012-01-27 10:48 (somehost) jham pts/14 2012-01-27 16:45 (localhost.localdomain) we want to know only the user associated with stdin: $who -m
jham pts/14 2012-01-27 16:45 (localhost.localdomain) now get the host only and save to a variable: myhost=$(who -m | head -n1 | awk '{printf $5}' | sed -e 's/(\(.*\))/\1/')
define group of hostnames to react: goodhosts=(goodhost anotherhost localhost.localdomain)
react: case "${goodhosts[@]}" in
*"$myhost"*) echo "good host" ;; *) echo "bad host" ;; esac You could put it into a file which is sourced on login (like .profile, depending on your configuration). Friday, January 20. 2012Case insensitive token matching in Notion/Ion3To enable case insensitive token matching in Notion's menus like "Attach Window" (META-A) and "Go to Window" (META-G) add this line to any "dopathed" file in the notion configuration:
That will save some time while navigating or layouting your workspaces. Monday, December 12. 2011Reduce the size of PDF documentsUse case: You are using (La)Tex to create your document and include some big non-vector graphics or high-quality scanned documents via \includepdf{} from pdfpages package. You could resize/size-optimize your included parts one by one to make your resulting PDF document smaller. Or you could compile your document and then use a trick to reduce the size of the final compiled document as PDF at once: pdf2ps finaldoc.pdf finaldoc.ps && ps2pdf finaldoc.ps finaldoc_reduced.pdf That way I managed to reduce the document size from 22MB to 4MB. Of course, the effect depends on the material included in your document. Give it a shot. Update (2012/01/20): If the hint above is still not enough you might want to try to reduce the final size with gs via PDFSETTINGS option described in the Ghostscript Documentation:
You can apply the desired parameter using ps2pdf:
or gs:
Since it will lower the quality of the document it is advisable to check whether the document will still meet the requirements for the usage intended. Saturday, November 12. 2011Eclipse (EE) crashesSome months ago Eclipse EE (Indigo) started to crash whenever Java EE view was active and I selected the menu entry "Window->Web Browser". Somewhere in the WWW I've found a solution by adding following lines into eclipse.ini: -Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-2.0/ Posting it here for the logs. Today I got the problem on another machine and had to login into the machine where I already altered eclipse.ini to see which lines were relevant. Now it's here, just in case it happens to me somewhere else again.
-Dorg.eclipse.swt.browser.UseWebKitGTK=true Monday, April 11. 2011Scrollgeschwindigkeit im VimperatorDamit man im Vimperator gefühlt noch schneller browsen kann, die Scrollweite hochsetzen mit dem Eintrag in .vimperatorrc: nnoremap j 7j
nnoremap k 7k
Posted by Juri Hamburg
in Software
at
19:49
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: software, vimperator
Sunday, March 6. 2011Линукс не для тебя. Брось это.Серьёзно, не трать сил и стараний. Это свыше твоих возможностей. Ты напрасно потратишь Ты думаешь, я шучу? Ни капельки. Делай то, что не можешь перестать делать, но не жалуйся позже не то, что тебя не предупреждали. У тебя не те мотивыТы умственная компьютерная элита. По крайней мере считаешь себя таким. Ты пользуешься хакерскими программами как Firefox и mIRC, ты знаешь элитные подпольные форумы и у тебя есть страничка на яндексе. Ты ремонтируешь компьютеры других (то есть, ты форматируешь их жёсткие диски и устанавливаешь заново Windows). И вообще, в твоём классе все тебя считают экспертом по компьютерам. Но у тебя есть одна проблема. Тебе скучно (да ещё и каникулы)... Ты прощёлкал мышкой весь свой не лицензионный Windows - знаешь все эти прекрасные настройки. В принципе, тебе даже нравится Windows, но с ним ты больше не чувствуешь себя достаточно элитным - в конце концов, на сегодняшний день, им пользуется каждый. До этой поры, ты ограничивался тем, давать квалифицированные комментарии на форумах и радовал твоих читателей изречениями как "LOL! Сраный M$! OMFG!11111одинодинодиннадцать" и "Вонючий масдай!!!одинодинодин", только чтобы дать всем понять о твоём глубоком и обоснованном отвращении к Windows. Но тебе этого больше недостаточно. После пятой партии Counterstrike ты заглядываешь к своим корешам в IRC. Там тебе рассказывают о настоящей хакерской операционке. Ибо элита пользуется Линуксом. От тебя слышат сразу же только "Ого, вот это офигенно!" и ты ещё успеваешь добавить "а где надыбать ISOz?". Но далее ты не воспринимаешь ответ; Ты уже давно на Piratebay и ищешь там Linux 9 или Linux 10. Всё равно. Как истинный хакер, ты уже конечно знаком с "расшариванием" и с твоей супер-бупер-быстрой безлимиткой ты быстро скачиваешь DVD c Kubuntu. Хотя ты и не уверен, что делать с этим "ubuntu-10.10-desktop-amd64-alpha1.iso", к счастью есть форум, где тебе советовали не распаковывать этот файл твоим любимым архиватором, и вообще, это не та архитектура. Установка, на данный момент, настолько идиотически проста, что через несколько мгновений твой новый Линукс с KDE улыбaется тебе рабочим столом. Windows, ты подумал, тебе уже так и так не понадобится - поэтому ты удалил его при этой возможности. Линукс - не замена WindowsНу вот ты и сидишь перед твоим Линуксом 10.10 и пытаешься в нём разобраться. "В принципе," - говоришь ты себе - "это очень даже мило". Но ты не можешь найти систему управления. Вообще, некоторые вещи не функционируют и ты задаёшь себе вопрос, почему ты не можешь воспроизвести твои .mp3 файлы. Ты спрашиваешь себя, зачем в 2010-ом году нужна консоль. В скором времени тебе выявляют апокалипсис. Обнаруживается то, что ты не считал возможным: О, ужас - под Линуксом не работает твоя любимая стрелялка! Эта новость тебя довольно-таки подламывает. Ну ладно - думаешь ты - ты высоко мотивированный и новый человек - потренируюсь-ка я в Photoshop'е. О, да, ещё один нюанс - Photoshop тоже не идёт. Только Gimp. Какая замена. Вообще ты удивляешься, почему в твоём стартовом меню так много программ - и ничего полезного. Но ты настоящий хакер. Ты не сдаёшься. Ты упрям. Ты намерен доказать всем насколько ты элитарен. Ты же ведь уже заявил в школе, что ты элитный Линукс-хакер. Но по настоящему подружиться с твоим Линуксом всё-таки пока не получается. Напротив, ты находишь всё очень запутанным и тебя постоянно направляют на какие-то Howtos и "Маны" и всякие не занимающие вещи. Читать? Да ну нафиг! С таким бы успехом ты мог бы начать читать заданный в школе "Война и мир". Кому нужно чтение, если у него дома компьютер? Излишне! Ты задаёшься вопросом, чего там все находят в этом Линуксе? Каким образом это когда-либо может стать заменой "Вендовозу", если там не не работают простейшие вещи? Идея, что Линукс - это альтернатива, не приходит тебе даже в голову. В конце концов - KDE даже оптически смахивает немного на Windows. Всё равно, сдаться вне обсуждении. Ты думаешь о том, как это архаичное что-то может заменить Windows. Как эти странные DEB могут быть комфортнее двойного щелчка на "setup.exe"? Ты начинаешь скучать по повседневным вещам: "Что? Скомпилировать ядро? Я же просто хочу разрешение выше 800x600 на рабочем столе". Ты не готов набираться знаний"Раньше", думаешь ты, "я просто щёлкал по кнопочкам до тех пор, пока оно не начинало работать". Для тебя кажется логичным, что под Линуксом должно получаться так же. 15 постов на форуме и 20 часов в IRC позже и после того, как ты прокопался через кучу "RTFM"ов, ты находишь два или три сострадательных совета. Ты не понимаешь, что хотят от тебя эти люди. Каждый когда-то начинал! Почему тебе не помогают? Почему все настолько не дружелюбны? Высокомерный народ, эти Линуксоиды. Лучшее, что ты от них слышишь, это ссылки на какие-то бесполезные ресурсы на английском. Не то чтобы ты бросал на них взгляд, ведь дать простой ответ на твой простой вопрос не может быть таким тяжёлым. Все вокруг виноваты, только не ты. И почему Линукс не такой как Windows? Такой удобный для начинающих и простой. С тебя достаточно. "Если это всё, что Линукс может дать, тогда я с радостью останусь на Windows", думаешь ты. Пересесть заново на Windows после самых долгих трёх дней твоей жизни тебе даётся не особо тяжело, особенно после того, как тебе в IRC посоветовали "прооптимировать" твой жёсткий диск: <xxx> набери просто if=/dev/random of=/dev/hda bs=1M count=2048 Конечно же, ты это сделал. Ты даже не поинтересовался, что ты этим сделаешь. Зато, ты на данный момент вылечен от Линукса. Но недавно, в IRC, тебе сказали, что на твоём маршрутизаторе тоже установлен Линукс и что с ним можно вытворять невообразимые вещи. Ты попробуешь это обязательно. На следующих выходных. Свободный перевод немецкого оригинала "Linux ist nichts für dich. Lass es." с разрешения автора. Creative Commons Attribution-NoDerivs 3.0 Unported License. Tuesday, February 22. 2011Betrugsfalle beim AutoverkaufEigentlich wäre das Betrugsverfahren gar nicht wert es zu beschreiben, wenn es nicht in die Kategorie Hardware Hacking fallen würde. An dieser Stelle möchte ich explizit darauf hinweisen, dass ich nicht zum Nachahmen animieren möchte, sondern lediglich einen Trick beschreibe, auf den ein Verwandter von mir fast reingefallen ist. Zielopfer: privater Diesel-Autoverkäufer (A) Betrüger: mindestens zwei Personen (B1 und B2) Umgebung: frostige Temperatur • Bs einigen sich auf den vorgeschlagenen Preis • B1 setzt sich ans Steuer um den Motor anzulassen und betätigt den Hebel zum Öffnen der Motorhaube • B2 öffnet die Motorhaube und schraubt den Öldeckel am Motor ab (um dort "prüfend" reinzuschauen) • B1 dreht den Zündschlüssel ohne abzuwarten bis Zündungsspirale warm ist. Dabei startet der Motor dementsprechend lange und kurz bevor er nun starten soll, lässt B1 die Zündung wieder los (dabei guckt B1 noch ganz fragend). Dies wird 2-3 mal gemacht, bevor man den Motor starten lässt. • sobald der Motor (schwer) startet drückt B1 stark auf das Gaspedal. Ergebnis: durch das "Leiern" und Ansaugen der Luft kommt aus dem Auspuff eine schwarze Flüssigkeit rausgeschossen und die Bs reden einem ein, dass es Motorschaden gibt und bieten die Hälfte des abgemachten Preises an. Jemand der technisch weniger versiert oder älter ist, steht erstmal unter Schock und ist froh das Auto mal überhaupt loszuwerden. Wenn dabei noch die Bs sehr gut spielen, hat ein Opfer wenig Chancen. Mich hat die Story ziemlich sprachlos gemacht. Ich denke, auf solche Tricks (wahrscheinlich gibt es mehrere dieser Art), sollte man als Privatverkäufer gut vorbereitet sein. Thursday, February 10. 2011Ein Personalausweis beweist noch lange nichtsIch In der Praxis bedeutet das, wenn der Ausweis nicht in meinem aktuellen Landkreis ausgestellt worden ist, muss man Geburtsurkunde und Einbürgerungsurkunde mitbringen. Beim zweiten Dokument, übrigens, darf ich meine Eltern bitten mir es von WeitWeitWeg zukommen zu lassen. Bis es soweit ist, läuft wahrscheinlich mein Personalausweis ab. Noch mal zum auf der Zunge zergehen zu lassen: Man braucht einen extra Nachweis, dass die Daten in einem nicht abgelaufenen deutschen Personalausweis auch stimmen. Wozu der Ausweis dann eigentlich? P. S.: Das ist keine rhetorische Frage - Erklärungen sind willkommen. Sunday, January 16. 2011Pegel der Murg in RastattHeute habe ich ein schönes Photo bekommen, das den Pegelanstieg der Murg veranschaulicht. Das untere Photo zeigt den "Normalzustand". Das Obere wurde am 13.01.2011 geschossen. Die Häuser neben dem Kanal liegen geschätzt ca. 1.5 Meter unter der Böschungskante. Wednesday, January 12. 2011IMAP Fehlermeldung: "Web Login required" bei GMailHeute habe ich von WARNING: Error occured attempting to sync account gmail: [ALERT] Web login required Gründe dafür u.A. könnten sein: Passwort kürzer als 8 Zeichen oder zu klein gewählter Zeitinterval zwischen den IMAP/POP3 Anfragen. Das lösen des Captchas auf https://www.google.com/accounts/DisplayUnlockCaptcha behebt das Problem. Sollte es öfter geschehen, muss wahrscheinlich die Zeit zwischen Abfragen erhöht werden. Offiziell sollte die Zeit mindestens 10 Minuten betragen. Aber, psst.. mal unter uns, funktioniert es auch mit 4 Minuten seit Monaten wunderbar. Saturday, October 23. 2010Entfernen aller Dateien, die zuvor mit unzip extrahiert wurdenAuch wenn sowas nach einigen Jahren Erfahrung nicht passieren sollte: ein Mal guckt man nicht in die Dateiliste eines Archivs vor dem Entpacken und schon hat man ein Verzeichnis zugemüllt. Heute speziell bei mir: unzip. Da das nun nicht das erste (und wohl auch nicht das letzte) Mal gewesen ist - ein schmutziger "Einzeiler" für die bash für das Entfernen der zuvor mit unzip entpackten Dateien, damit ich beim nächsten mal nicht wieder Zeit verliere. Anzuwenden im selben Ordner, in dem die Dateien entpackt worden sind und in dem das Archiv liegt.
Der Skript wird leider alle beim Entpacken erstellte Ordner nicht löschen (war bei mir in diesem Fall nicht relevant). Da könnte einem hinterher noch folgendes behilflich sein:
Das soll im Arbeitsverzeichnis rekursiv alle leeren Ordner löschen. Nicht elegant, aber wer braucht schon leere Ordner? *hust* Für das regexen der Ordnernamen aus der Archiv-Dateiliste war ich (noch) zu faul. Achtung: getestet nur an einem meinen konkreten Fall, ohne Gewähr, etc. Update: Lösung für das Mitnehmen von Ordnern wäre:
(Ungetestet). Hier besteht allerdings die Gefahr, dass man Ordner, die vor dem Entpacken des Archivs existierten, mitnimmt.
(Page 1 of 3, totaling 38 entries)
» next page
|
QuicksearchStatic FailsCategorized FailsFails2Tagsgeshi gmail musik python xorg funambol php pdf synchronisation tmux alsa cron html auto ibm wikir keyboard hack htc evdev flash xmodmap freiheit google eclipse rest s9y docutils mac windows transcode imap lua x41t mediawiki screen pop3 webdav fun thinkpad restructured text opera music unzip latex editor mobile ffmpeg css video vim debian archlinux ion3 überwachung firefox privacy hardware notion zensur vimperator politik bash politics misc datenschutz linux software
Archived Fails |
