arielvb’s notes¶
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:
Applications¶
Firefox¶
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.
Ubuntu - Instal·lació des de els repositoris de Mozilla¶
Afegir repositori i instal·lar firefox:
sudo add-apt-repository ppa:mozillateam/firefox-stable sudo apt-get update sudo apt-get upgrade
Instal·lar paquet d’idioma català, canviar ca per es si es vol castellà:
sudo apt-get install firefox-locale-ca
Arrancar Firefox i escriure a la barra de navegació:
about:addons
Clicar a l’icona d’eines i triar l’opció Check for updates / Comprova si hi ha actualitzacions
Reiniciar Firefox.
Complements¶
Url: about:addons
Llista de complements intersants:
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 predeterminada. | |
adblock plus: | bloqueja els anuncis de les pàgines web. Per que una navegació sense publicitat no té preu. |
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);}
References¶
- http://support.mozilla.org/ca/questions/779082 (2012-10-28)
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
Command line¶
Create pdf from all the odt of the current dir:
lowriter --headles --convert-to pdf *.odt
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/
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
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.
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

SSH forwarding
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")]
Command line¶
Colorize¶
The command line with colors looks so pretty!
grep¶
Use the argument –color:
grep --color=auto
The options are:
- auto: doesn’t colorize if the output is a pipe.
- always
- never
less / more¶
Use the argument -R (or -r):
more -r
Example colorize grep output:
rgrep --color=auto TODO . | more -r
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
Ripping DVD with FFMPEG¶
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
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
Imagemagick¶
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):
convert tiles_*.gif -mosaic recover.gif
SoX - Sound eXchange¶
SoX the sound utility!
Website: | http://sox.sourceforge.net/ |
---|---|
Category: | audio, convert, cmd, nogui |
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 website and build it from source.
Ubuntu 12.04¶
Note
- To install sox quick with mp3 support run:
- sudo apt-get install sox libsox-fmt-mp3
If you wan’t to install SoX only or know about the extra packages continue reading.
Install using the repository version of SoX:
sudo apt-get install sox
Enable mp3 encoder:
sudo apt-get install sox libsox-fmt-mp3
Mac OS X¶
SoX can be installed using homebrew, first check the build options with:
brew info sox
The diferents options extends the default behaviour with some extra encoders (conversion formats), check the end of this section to know what are the diferents options.
To build without extensions (without mp3, ogg conversion):
brew install sox
One of the extra encoders is provided by libvorbis, offering encoding file as ogg, to isntall this incoder you must have not installed SoX and run:
brew install sox --with-libvorbis
Usage¶
SoX is really easy to use, if you know how to use a commandline program. Take a look to the next examples, and you will discover some of the features of SoX.
Play an audio file:
play filename
Convert an mp3 to ogg (the output format is autodected using the new file extension):
sox filename newfile.ogg
Concatenate two or more audio files:
sox filename1.wav filename2.wav filename3.wav file1to3.wav
Advanced usage¶
Create spectrogram:
sox casa.mp3 -n spectrogram
Tunning spectrogram example params:
sox casa.mp3 -n spectrogram -Y 130 -l - casa_spec.png
Reverse sound track:
sox casa.mp3 reverse asac.mp3
Some interesting resources¶
- Sox Documentation: http://sox.sourceforge.net/sox.html
- Building sox with mp3 support on Mac: http://ggkarman.de/tech/building-sox-with-mp3-support-on-osx/
Vi/vim¶
- Go to line, Ctrl+C::
- :[linenumber]
- Go to character (very usefull to debug Python unicode errors)::
- :goto [charnumber]
Development¶
Apache¶
Notes about Apache Web Server.
htaccess: Tips¶
..note:
This notes are in Spanish
Redirigir http a https¶
Requisito: modRewrite
Crear un fichero .htaccess y introducir el siguiente bloque de reglas:
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Proteger con usuario y contraseña¶
Requisito:
AuthUserFile [RUTA AL FICHERO DE AUTENTIFICACIÓN] AuthName “[TEXTO IDENTIFICATIVO SITIO]” AuthType Basic require valid-user
Warning
La ruta del fichero de autentificación ha de ser absoluta
mcrypt for Mac and PHP¶
Website: | http://mcrypt.sourceforge.net/ |
---|---|
Tags: | software, mac, php, magento |
Mac OS comes with Apache and PHP installed, but maybe you need some extensions that doesn’t come with the default installation.
If you need mcrypt you have to options reinstall PHP on Mac OS X installation with a new version using homebrew or install only the extensions you need.
Note
This instrucctions are for Mac OS X 10.6
Requeriments¶
- XCode
Installing mcrypt¶
To install the mcrypt extension for PHP, first you need to install mcrypt and once installed you need to compile the extension for your PHP version.
The installation mcrypt, you need to compile the source code or install it with homebrew:
brew install mcrypt
Warning
If the default formula doesn’t work you can try with a diferent one, check out the section Custom brew formula.
The next step is build the PHP extension for your PHP version. First you need to know the PHP version of your Mac:
php -v
And then downlad the source code of the same PHP version, in my case 5.3.15, from php.net or using the spanish mirror:
wget http://es1.php.net/distributions/php-5.3.15.tar.bz2
Extract the source code:
tar -xf php-5.3.15.tar.bz2
And go to the mcryp extension diretory:
cd php-5.3-15/ext/mcryp
Prepare the extension to compile:
phpize
And execute the next oneliner:
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config; make -j6;
If the oneliner ends without any error, install the extension:
sudo make install
The most probable error is related with PHP_FE_END or ZEND_MOD_END. To fix this you must edit the ext/mcrypt/mcrypt. and add at the begginning of the file, the definition of both:
#define PHP_FE_END {NULL,NULL,NULL}
#define ZEND_MOD_END {NULL,NULL,NULL,0}
Then you must exectute the onliner and the install instruction.
Now you have everithing installed, but your PHP installation doesn’t know that mcrypt is avaible; to activate this extension you need to edit the /etc/php.ini file adding the next line:
extension=mcrypt.so
Note
If this file doesn’t exists you will find a php.ini.default in the same folder; create a copy of it as php.ini
And check that the extension is correctly installed:
php --info | grep mcrypt
Finally restart Apache:
sudo apachectl restart
Custom brew formula¶
Replace the file /usr/local/Library/Formula/mcrypt.rb with:
require 'formula'
class Mcrypt < Formula
homepage 'http://mcrypt.sourceforge.net'
url 'http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz'
sha1 '9a426532e9087dd7737aabccff8b91abf9151a7a'
option :universal
def install
ENV.universal_binary if build.universal?
system "MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking --prefix=#{prefix} --mandir=#{man}"
system "make -j6"
system "make install"
end
end
Installation log¶
The installation fast notes:
PHP_VERSION="5.3.15"
# or using bash replace
a=`php -v`;
PHP_VESRION=${a:4:6}
brew install mcrypt
wget http://es1.php.net/distributions/php-$PHP_VERSION.tar.bz2
tar -xf php-$PHP_VERSION.tar.bz2
cd php-$PHP_VERSION/ext/mcryp
echo "copy next lines into ext/mcrypt/mcrypt.c"
echo "############################"
cat << EOF
#define PHP_FE_END {NULL,NULL,NULL}
#define ZEND_MOD_END {NULL,NULL,NULL,0}
EOF
echo "############################"
phpize
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config; make -j6;sudo make install
sudo echo "extension=mcrypt.so" >> /etc/php.ini
# Check if the new extension is avaible
php --info | grep mcrypt
# restart apache
sudo apachectl restart
Python for apache¶
Installation¶
Mac Os X¶
Install mod_wsgi using brew:
brew update brew install mod_wsgi
Edit the /etc/apache2/http.conf and add:
LoadModule wsgi_module /usr/local/Cellar/mod_wsgi/3.3/libexec/mod_wsgi.so
Note
- The exact path for mod_wsgi can be found with::
- brew list mod_wsgi
wsgi frameworks¶
References¶
- http://stackoverflow.com/questions/4341769/how-can-i-get-mod-wsgi-working-on-mac
- Flask Deployment Documentation, http://flask.pocoo.org/docs/deploying/mod_wsgi/
mod_proxy http://httpd.apache.org/docs/current/mod/mod_proxy.html
Proxy Server¶
BlackBerry¶
Connect via ssh [1]¶
If you have previously configured Eclipse to work with your Blacberry device, you can reuse the existing sshkey.
In Mac OS X you can find it at ~/Library/Research In Motion/ in other OS you can find the exact path in the Eclipse Preferences searching for BlackBerry Plugin.
Run blackberry connect, remenver change the executable path, password and ip before execute:
/Users/arkow/projects/blackberry/blackberry.tools.SDK/bin/blackberry-connect 192.168.1.34 -sshPublicKey "/Users/arkow/Library/Research In Motion/bbt_id_rsa" -password dummypasword
Open the ssh connection, using devuser as username:
ssh devuser@192.168.1.34 -i bbt_id_rsa
[1] | using eclipse credentials |
Buildout¶
Procès:
sudo pip install zc.buildout
buildout init
wget http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py
URI’s¶
- Buildout web site: http://www.buildout.org/install.html
Encodings¶
In a perfect world only one encoding will exist, but that will not be funny. Dealing with encodings normally is a pain, because the list of encoding formats is too long but the more common are ascii, utf-8, machintosh, windows, iso-xxxx-x.
Some encodings has reduced, or none, support to non english characters like á or ñ.
Utilities¶
iconv¶
iconv converts file from one encoding to another; is a encoding converter.
iconv is a comand line program, check program options with man iconv or iconv –help; or take a look to the next examples for the most common.
The first example, will convert a file in utf-8 to iso-8859-1 [1]:
iconv --from-code=UTF-8 --to-code=ISO-8859-1 file.csv > file.csv
[1] | Microsoft Excel has some issues displaying UTF-8’s characters in CSV files, but not with the ISO-8859-1’s encoding. |
Jenkins and Python¶
https://wiki.jenkins-ci.org/display/JENKINS/ShiningPanda+Plugin https://docs.shiningpanda.com/builders/freestyle.html
nosetests http://readthedocs.org/docs/nose/en/latest/
Tutorial: http://www.rhonabwy.com/wp/2009/11/04/setting-up-a-python-ci-server-with-hudson/
Mono¶
url: | http://www.mono-project.com/ |
---|---|
docs: | http://www.mono-project.com/docs/ |
api: | http://docs.go-mono.com/ |
tags: | programming language, opensource, .net |
Mono appeared on 2004 as a crossplatform .NET framework opensource implementation.
Note
This documents covers only C# features of Mono.
Building your sources with the commandline¶
If your sources have a .csproj/.sln file you can use mdtool to build it, if not you can compile it with Mono C# compiler (mcs).
Using the Mono C# compiler: mcs¶
url: | http://linux.die.net/man/1/mcs |
---|
Lets supose you have a single source hello.cs, with the following content:
using System;
class Hello {
static void Main() {
Console.WriteLine ("Hello, World!");
}
}
You can build it running:
mcs example.cs
Using MonoDevelop: mdtool¶
To obtain mdtool, you will have to install MonoDevolop or Xamarin Studio.
Code analizers¶
Assembly analizer: gendarme
After running gendarme on our example hello.cs:
mcs hello.cs && mono gendarme.exe hello.exe
We will see a listing with all the defects in our assebly, after fixing them our code will look like:
using System;
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: CLSCompliant (true)]
[assembly: ComVisible (false)]
[assembly: AssemblyVersion ("1.0.0.0")]
static class Hello {
static void Main() {
Console.WriteLine ("Hello, World!");
}
}
Documenting your code¶
If some one else needs to use your code, you probably should to generate some documentation for your classes, methods one great tool is Doxygen.
Code coverage¶
Reports¶
After running the codecoverage for your tests probably you want to create a report, you can use ReportGenerator
References¶
Extras¶
PERL¶
Per was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions. The latest major stable revision is 5.16, released in May 2012. Perl 6 is a complete redesign of the language, announced in 2000 and still under active development as of 2012s.
– Wikipedia 2013-02-18
API¶
The perl api is avaible online [1]. It has also a command line tool called perldoc
[1] | http://perldoc.perl.org/ |
Packages/Modules¶
Packages, modules or distributions can be administrated with the package manager: cpan
To install a new packages:
cpan $packagename$
Or entering in the interactive mode:
cpan
i $pacakgename$
Cheats¶
- http://perldoc.perl.org/perlcheat.html
- More visual (but less complete): http://www.cheatography.com/mishin/cheat-sheets/perlcheat/
PictureFlow¶
PictureFlow is a Coverflow widget for Qt, it was developed by Ariya.
..warning:
**Pictureflow (python) loves memory** usage.
250 images => 1.62 GB of RAM
50 images => 538 MB of RAM
**Pictureflow (cpp) also loves memory**
250 images => 1.39 GB of RAM
50 images (not the same pack as in python) => 99 MB of RAM
Resize images¶
Before call pictureflow you must created a resized version of your images, or tu much memory will be allocated!
You can resize faster with imagemagick, for exemple to resize all the jpg in your folder using bash and convert:
for i in `ls *.jpg`; do convert -sample 512x512 $i 512_$i; done
This will make that PictureFlow only uses 225 MB of RAM for 250 images.
Build¶
Donwload last version of pictureflow from the github repository of Ariya:
git clone https://github.com/ariya/pictureflow.git
Run go to pyctureflow-qt/pyqt/lib and run:
qmake make install
If make install donsn’t copy anything, copy pictureflow lib (pictureflow.a) to:
/Applications/QtSDK/Desktop/Qt/4.8.1/gcc/lib
Go to pyqt folter, one level up and run (better step by step):
python configure.py make make install
Edit the demo.py file to add your image path, and run it with python.
Other references¶
PictureFlow - listing images in PyQt4 http://www.rkblog.rk.edu.pl/w/p/pictureflow-listing-images-pyqt4/
The Calibre plugin pictureflow.
Python¶
Notes about Python.
Python Freezers¶
ICC - Profiles¶
Per treballar amb perfils de color amb python cal:
- LittleCMS
- PIL
Com instal·lar els requsitis, s’explica a continuació.
Mac (Previament cal tenir brew instal·lat):
brew install lcms
brew install pil
...
MySQL for Python¶
Pandas¶
Pandas Data Analyst library for Python.
Website: | http://pandas.pydata.org |
---|---|
Tags: | python, data, analysis |
Installation¶
First install some of the requerid packages, using pip:
pip install numpy
Install pandas:
pip install pandas
Check that pandas has been installed correctly:
python -c "from pandas import *"
If you have and old version of python-dateutil, for example 1.5, pandas will raise an import error; you must upgrade python-dateutil:
pip install --upgrade python-dateutil
Pypi¶
Pypi is the Python pacakage index, also know as Cheesechop.
Register an account¶
The website allows register an account to upload pacakges. You can login also login using OpenId.
Register a package¶
One you have a package created and before uplooad you must register it:
python setup.py register
Uploading a package¶
To upload a package you must create a distribution, using sdist, bdist...
To upload the sdist:
python setup.py sdist upload
The fast way¶
python setup.py register sdist upload
Sphinx¶
Mac Os X¶
Themes Location¶
- For example for builtin system Python-2.6 and Sphinx-1.1.2, the theme’s path is::
- /Library/Python/2.6/site-packages/Sphinx-1.1.2-py2.6.egg
Themes¶
Some beatutiful themes from various places and authors.
- Read the docs: https://github.com/snide/sphinx_rtd_theme
- Sphinx Bootstrap: https://pypi.python.org/pypi/sphinx-bootstrap-theme
Webfaction¶
Crea lloc web¶
Cal crear un website: dominis (domini + www.domini), aplicacio, usuaris (opcional).
https¶
S’ha de crear tant la versió http com https (2 websites) amb la mateixa aplicació (o no) i els mateixes dominis
Crear usuari¶
- Des de la web crear un usuari amb access a consola, més tard restringirem l’accès per a que només pugui accedir per ftp.
- Crear la carpeta de l’aplicacio.
- Afegir permisos d’excucio al directori de l’usuari principal al nou usuari:: setfacl -m u:[usuari]:–x $HOME
- Afegir permisos al directori concret:: setfacl -m u:[usuari]:–x $HOME/[directori]
Git¶
- Anar a la carpeta repos de l’aplicació on està instal·lat git::
cd webapps/gitpxc/repos
git init –bare {repo}.git cd {repo}.git git config http.receivepack true
Editar la descripció del projecte:
vi description
Definir els autors afegir al fitxer config:
[gitweb]
owner = Ariel
A la nostra màquina dins de la carpeta que volem afegir al repositori:
git init
touch README
git add README
git commit -m "First commit"
git remote add origin https://dev.arielvb.com/git/{repo}.git
git push origin master
mod_wsgi i AuthUserFile¶
Per protegir directoris dins d’una aplicació amb mod_wsgi cal carregar els moduls d’Apache corresponents, ja que per defecte es carreguen.
Cal editar el fitxer apache2/conf/http.conf i afegir:
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_user_module modules/mod_authz_user.so
Si volem protegir totes les rutes cal afegir al bloc directory:
AuthUserFile [ruta al fitxer htpasswd]
AuthName "[Text a mostrar a la finestra de carrega]"
AuthType Basic
require valid-user
Si només volem protegir una part de la aplicació cal crear un nou bloc:
<Location [ruta]>
AuthUserFile [ruta al fitxer htpasswd]
AuthName "[Text a mostrar a la finestra de carrega]"
AuthType Basic
require valid-user
</Location>
wxwidgets¶
Website: | http://wxwidgets.org |
---|
Installation¶
Mac OS X¶
Install wxwidgets under Mac OS is really easy with brew; but it takes some time because homebrew compiles wxwidgets before installing the python bindings.
Once is installed you must modify the PYTHONPATH enviroment variable to point to the installation path, something like that:
export PYTHONPATH=/usr/local/Cellar/wxmac/2.9.4.0/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa:$PYTHONPATH
A good place to add this line is in your ~/.bash_profile
Python Bindings¶
At the of wxpython.org you will find an example <http://wiki.wxpython.org/Using%20wxPython%20Demo%20Code> to test if everithing has been installed correctly.
A full package of demos are avaible for download at: http://wxpython.org/download.php#demo
Note
The demo application bundle for mac, doesn’t work if you have installed wxwidgets with homebrew.
Mac Os X¶
Mac Os X: Command line¶
List of commands¶
Change user shell, with chsh (add or change user database information), next changes to zsh:
chsh -s /bin/zsh
Extend Command line tools¶
brew¶
Homebrew installs the stuff you need that Apple didn’t.
—HomeBrew
gettext¶
Install with brew:
brew install gettext
Installs the libraries and the utilities:
autopoint envsubst gettext gettext.sh gettextize msgattrib msgcat msgcmp msgcomm msgconv msgen msgexec msgfilter msgfmt msggrep msginit msgmerge msgunfmt msguniq ngettext recode-sr-latin xgettext
But doesn’t add to your path! You need to modify the env. variable $PATH:
vi ~/.bash_profile
And add to the end or modify previous declarations:
export PATH=${PATH}:/usr/local/opt/gettext/bin
grolwnotify¶
growlnotify http://growl.info/extras.php#growlnotify is a command line tool to display notifications from the command line with Growl.
For example, lauchn a fake notification from Disk Utility:
growlnotify -t "Warning" -a Disk\ Utility -m "Replace your disk!"
More interesting is use a custom image icon, with the –image parameter:
growlnotify -t "My App notification" --image icatpy/icat.png -m "Hello!"
imagemagick¶
imagemagick is a image processing program; it’s a group of commandline programs: convert, mogrify...
Inkscape¶
Convert svg to png using inkscape, first you must download and install Inkscape:
/Applications/Inkscape.app/Contents/Resources/bin/inkscape -f test.svg -e test.png
Remove MacOsX custom files from zip¶
To see the contents of a zip file:
unzip -l filename
To remove zip contents, for example everithing inside __MACOSX:
zip [filename] -d __MACOSX/*
Dictionary¶
To create custom dictionaries you must have XCode installed in your machine.
One instaled, inside the developer extras exists a Dictionary Development Kit, with this you can build your own Dictionary.
The projects_templates folder has a demo of a dicitionary, you can test it with:
make
make install
# Launch the Dictionary application
The dictionary My Dictionary will be installed in:
~/Library/Dictionaries
Various¶
Blender¶
Website: | http://blender.org |
---|---|
Tags: | Software, opensource, modeling, textures, 3D, game, engine |
Blender is a 3D modeling software and game engine, is opensource, and free, you can download it at their website; as a plus is multiplatform (Linux, Mac OS X, Windows)!
You will find also in the website some short videos to start with Blender; and also others more complex.
To know more¶
Textures and Materials¶
A list of free (or not) websites with textures for your models.
- http://www.cgtextures.com/
- http://www.imageafter.com/
- http://www.dougturner.net/blendersite/
- Open Material Repository (new site under construction since 2009?)
Scripting¶
Others¶
Sintel Game (Game created with blender)
Gnome Shell¶
Launchers¶
To create a launcher for a custom application, you must create a .desktop file under /usr/share/applications, ~/.local/share/applications or ~/Desktop
As an example the next launcher is for Blender:
[Desktop Entry]
Encoding=UTF-8
Name=Blender
Exec=/path/to/blender/executable
Icon=/path/to/blender/icon
Type=Application
Categories=Graphics;
References¶
- Desktop Files (Gnome): https://developer.gnome.org/integration-guide/stable/desktop-files.html.en
- Freedesktop Categories: http://standards.freedesktop.org/menu-spec/latest/apa.html
GPS - Tracker’s and more¶
Subject: | GPS tracking systems and utilities |
---|---|
Modified: | 2015-05-04 03:14 |
Date created: | 2012-10-24 |
Version: | 1.0 |
Contents
Tracking¶
GPS Data Master (Blackberry)¶
GPS Data Master is a tracking application for Blackberry devices, it’s avaible free of charge at the Blackberry AppStore.
One enabled the loggin option, every time the app is closed a file inside the documents folder is stored. The track will be stored in GPX format, this format need to be convert to kml if we want to see it in Google Maps, see gpx to kml.
Visualization¶
Google maps¶
With Google Maps we can visualize kml files from any url or import a file to My Maps. If we want to visualize one of our files we only need to upload it to Dropbox or Google Drive and use the public link option.
The url of the kml file must be inserted in the Google Maps search box, or appended to the uri:
https://maps.google.com/maps?q=
More info at http://gis.stackexchange.com/questions/235/display-a-local-file-in-google-maps
Utilities¶
gpx to kml¶
This process can be done online at http://gpx2kml.com/, it offers usseful options like stats or view in Google Maps.

tags: | kml, gpx, google maps, gps |
---|
MIDI¶
What is MIDI? Take a look at https://en.wikipedia.org/wiki/Midi
Online resources¶
- http://www.classicalmidiconnection.com
- http://www.kunstderfuge.com/
- http://www.midiworld.com/ (some aren’t free)
- http://www.piano-midi.de/
Searcher¶
Configure VLC¶
- Download FluidSynth version of SoundFont from http://www.schristiancollins.com/generaluser.php.
- Open VLC’s preferences.
- The preferences window has two display modes called Simple and All. Choose the display mode called All.
- Go to Codecs -> Audio codecs -> FluidSynth.
- Then select the .sf2 file with the preferences select button.
Note
If the FluidSynth codec is not shown in the preferences, you must need install it, take a look at the first link in the References.