Arielvb's Notes
Total Page:16
File Type:pdf, Size:1020Kb
arielvb’s notes Release 1.0 @arielvb May 04, 2015 Contents 1 Applications 3 1.1 Firefox..................................................3 1.2 LibreOffice................................................4 1.3 Virtualbox................................................5 2 Command line 7 2.1 Colorize.................................................7 2.2 Ripping DVD with FFMPEG......................................8 2.3 Imagemagick...............................................8 2.4 SoX - Sound eXchange.........................................9 2.5 Vi/vim.................................................. 11 3 Development 13 3.1 Apache.................................................. 13 3.2 BlackBerry................................................ 17 3.3 Buildout................................................. 17 3.4 Encodings................................................ 17 3.5 Jenkins and Python............................................ 18 3.6 Mono................................................... 18 3.7 PERL................................................... 20 3.8 PictureFlow................................................ 20 3.9 Python.................................................. 21 3.10 Sphinx.................................................. 24 3.11 Webfaction................................................ 24 3.12 wxwidgets................................................ 26 4 Mac Os X 27 4.1 Mac Os X: Command line........................................ 27 4.2 Dictionary................................................ 28 5 Various 31 5.1 Blender.................................................. 31 5.2 Gnome Shell............................................... 32 5.3 GPS - Tracker’s and more........................................ 32 5.4 MIDI................................................... 34 i ii arielvb’s notes, Release 1.0 This are my notes, they help me to remember things. Most of my notes are about software development. Use the searchbox to find what you are looking for! Or take a look to the top sections: Contents 1 arielvb’s notes, Release 1.0 2 Contents CHAPTER 1 Applications 1.1 Firefox 1.1.1 Pàgines especials No totes les opcions de Firefox estàn accesibles des de les opcions dels menus. Algunes només es pot accedir escribint una adreça concreta a la barra de navegació i algunes de les opcions del menu tenen un accés també des de aquesta: • about:home la pàgina definida com predeterminada. • about:addons per accedir a la finestra de complements. • about:memory informació sobre la gestió de memòria. • about:support informació sobre la configuració tecnica del navegador. • about:config consulta i modificació de paràmetres configurables del navegador i complements. 1.1.2 Ubuntu - Instal·lació des de els repositoris de Mozilla 1. Afegir repositori i instal·lar firefox: sudo add-apt-repository ppa:mozillateam/firefox-stable sudo apt-get update sudo apt-get upgrade 2. Instal·lar paquet d’idioma català, canviar ca per es si es vol castellà: sudo apt-get install firefox-locale-ca 3. Arrancar Firefox i escriure a la barra de navegació: about:addons 4. Clicar a l’icona d’eines i triar l’opció Check for updates / Comprova si hi ha actualitzacions 5. Reiniciar Firefox. 1.1.3 Complements Url: about:addons Llista de complements intersants: 3 arielvb’s notes, Release 1.0 Firebug Per a tots aquells que creen webs i aquells que fan web-scrapping:) Web Developer barra d’eines per desenvolupadors, permet desactivar la memòria cau del navegador, javascript... Pearl Crescent Page Saver permet desar pàgina sencera, o la part visible, com imatge. JSONView visualitza les respostes JSON en colors i amb format directament al navegador [by laura.p] httpsEveryWhere activa la navegació per https a una serie de llocs web on no ho està de forma prede- terminada. adblock plus bloqueja els anuncis de les pàgines web. Per que una navegació sense publicitat no té preu. 1.1.4 Modify about:home search engine Modify the key search-engine in the chromeappstore.sqlite inside your profile. Default value in firefox-beta 17 is: > sqlite3 chromeappsstore.sqlite "SELECT * FROM webappsstore2 WHERE key=’search-engine’;" emoh.:moz-safe-about|search-engine|{"name":"Google","searchUrl":"https://www.google.com/search?q=_searchTerms_&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:es-ES:official&client=firefox-beta"}|0| To set duckduckgo as search engine: sqlite3 chromeappsstore.sqlite ’UPDATE webappsstore2 SET value=\’{"name":"DuckDuckGo","searchUrl":"https://duckduckgo.com/?q=_searchTerms_"}\’ WHERE key="search-engine";’ The easy way, in the about:home page, paste in the url field: javascript:{localStorage["search-engine"]="{\"name\":\"Google\",\"searchUrl\":\"http://www.google.com/search?q=_searchTerms_&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a\"}";void(0);} 1.1.5 References • http://support.mozilla.org/ca/questions/779082 (2012-10-28) 1.2 LibreOffice LibreOffice is a free and open source office suite, developed by The Document Foundation. It is descended from OpenOffice.org, from which it was forked in 2010. – Wikipedia 1.2.1 Command line • Create pdf from all the odt of the current dir: lowriter --headles --convert-to pdf *.odt Advanced command line tools unoconv is a command line tool to convert LibreOffice documents 4 Chapter 1. Applications arielvb’s notes, Release 1.0 1.2.2 References • https://en.wikipedia.org/wiki/Libreoffice • https://help.libreoffice.org/Common/Starting_the_Software_With_Parameters • http://rocreguant.com/como-instalar-un-nuevo-diccionariocorrector-para-libreoffice-en-ubuntu/270/ • http://www.computercorrect.com/2011/desktop-applications/openoffice-org/custom-fill-colors-in-openoffice- org/ 1.3 Virtualbox Virtualbox is a virtualizacion software, it’s opensource and is avaible under a GPLv2. You can download it for free at https://www.virtualbox.org/wiki/Downloads 1.3.1 Obtain images You can manualy install lot of OS. But if you want to start very fast VirtualBoxImages offers ready to launch images, some are free others not. Free VDI’s are avaible at http://virtualboximages.com/Free.VirtualBox.VDI.Downloads. 1.3.2 Tunning SSH To connect to guest using ssh, it’s needed to configure the port redirecton at the virtualbox image. You can do using the commandline or the gui. Using the commandline (when the image is stopped): VBoxManage modifyvm "VM name" --natpf1 "ssh,tcp,,2222,,22" Using the gui: Machine > Settings > Network > Port forwarding > Insert new Rule (+) And fill the table with (4th column is empty, see pecture): ssh | tcp | 127.0.0.1 | | 22 1.3.3 API Virtualbox has an API or SDK for developers, see SDK Programmin Guide at https://www.virtualbox.org/wiki/Technical_documentation The API can’t be used with Python, Java, C++, C or Visualbasic. The following example shows how to retrive the name of the existing machines: import vboxapi man = vboxapi.VirtualBoxManager(None, None) [i.name for i in man.getArray(man.vbox, "machines")] 1.3. Virtualbox 5 arielvb’s notes, Release 1.0 Figure 1.1: SSH forwarding 6 Chapter 1. Applications CHAPTER 2 Command line 2.1 Colorize The command line with colors looks so pretty! 2.1.1 grep Use the argument –color: grep--color=auto The options are: • auto: doesn’t colorize if the output is a pipe. • always • never 2.1.2 less / more Use the argument -R (or -r): more-r Example colorize grep output: rgrep --color=auto TODO . | more -r 2.1.3 pygmentize pygmentize colorizes the input allowing different lexers: pygmentize [-l lexer] [file] The lexer will be autodected, but if not some of the lexers are: • rst: reStructuredText • html • python 7 arielvb’s notes, Release 1.0 2.2 Ripping DVD with FFMPEG 2.2.1 Concatenate files With ffmpeg, you can concatenate video/audio files, for example if you want to concat a DVD movie in a single file: ffmpeg -i concat:VTS_01_0.VOB\|VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB -vcodec libxvid -qscale 0 ~/my_movie.mp4 Or if you want a single track with some of your favorites songs: ffmpeg -i concat:song1.mp3\|song2.mp3 -c copy songs.mp3 2.2.2 Rotate video Execute: ffmpeg -i 2015-01-01\ 00.*mp4 -vf "transpose=1" out.mp4 For the transpose parameter you can pass: 0 = 90CounterCLockwise and Vertical Flip (default) 1 = 90Clockwise 2 = 90CounterClockwise 3 = 90Clockwise and Vertical Flip 2.2.3 Tips List available codecs: ffmpeg-codecs 2.2.4 References • http://stackoverflow.com/questions/3377300/what-are-all-codecs-supported-by-ffmpeg • http://blog.desdelinux.net/howtorippear-o-copiar-un-dvd-a-mano-con-cat-y-ffmpeg/ [spanish] • http://stackoverflow.com/questions/3937387/rotating-videos-with-ffmpeg 2.3 Imagemagick 2.3.1 Creating tiles Basic usage: convert FILE -crop geometry tiles_%d.jpg Recomend usage for jpg files, tile + remove exif information: convert FILE -crop geometry -strip tiles_%d.jpg Recovering a copped image, (doesn’t work with jpg tiles): 8 Chapter 2. Command line arielvb’s notes, Release 1.0 convert tiles_*.gif -mosaic recover.gif 2.3.2 Creating gifs convert -delay 20 -loop 0 -resize 800x522 *.jpg ../grup.gif 2.3.3 Slicing images Slice and image in 3: convert -crop 34%x100% +repage beach.jpg beach_%d.jpg 2.4 SoX - Sound eXchange SoX the sound utility! Website http://sox.sourceforge.net/ Category audio, convert, cmd, nogui 2.4.1 Installation Note: SoX by default doesn’t have mp3 encoding support, to prevent legal issues with the mp3 patents. Some third pary packages/libraries permits you bypass that problem. Linux First check if SoX is avaible on your packagemanager, and check if that version is up to date, if the version is too old; consider download SoX from their