Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
code for food

Gianluca Pacchiella gipi

😎
code for food
View GitHub Profile
@gipi
gipi / 000.md
Created Jan 31, 2016
#printing
View 000.md

Booklet

Inspired by this post

$ pdftops -level3 Handbook_of_Computability_Theory.pdf - | psbook | psnup -2 | ps2pdf - booklet.pdf
[*] [1] [2] [*] [34] [3] [4] [33] [32] [5] [6] [31] [30] [7] [8] [29] [28] 
[9] [10] [27] [26] [11] [12] [25] [24] [13] [14] [23] [22] [15] [16] [21] 
[20] [17] [18] [19] Wrote 36 pages, 3968134 bytes
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] 
View 000.md
$ xrandr --current
Screen 0: minimum 8 x 8, current 1920 x 1200, maximum 32767 x 32767
eDP1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768       60.0*+   39.9  
   1360x768       59.8     60.0  
   1024x768       60.0  
   800x600        60.3     56.2  
   640x480        59.9  
DP1 disconnected (normal left inverted right x axis y axis)
@gipi
gipi / 000.md
Last active Feb 1, 2016
#machinelearning
View 000.md

Installing scikit-learn

# sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
$ pip install numpy
$ pip install scipy
$ pip install scikit-learn
@gipi
gipi / 000.md
Last active Jan 29, 2016
#ruby
View 000.md
# apt-get install ruby1.9.1-dev
$ gem install --user jekyll
#  update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby2.0 1
update-alternatives: using /usr/bin/ruby2.0 to provide /usr/bin/ruby (ruby) in auto mode

Manually

$ curl -sSL https://rvm.io/mpapis.asc | gpg --import -
$ curl -L https://get.rvm.io | bash -s stable --rails
@gipi
gipi / 000.md
Last active Jan 10, 2016
#gpg2
View 000.md
$ gpg2 --list-key --with-colons gp@ktln2.org
tru::1:1452083118:1489574824:3:1:5
pub:u:2048:1:FC8153E07D957F45:1452083023:::u:::scESC:::::::
uid:u::::1452083023::D421FF35F90CA954185A138F411E13645EF7A812::Gianluca Pacchiella <gp@ktln2.org>:::::::::
sub:u:2048:1:532EB870178BEFE9:1452083023::::::e::::::

$ gpg2 --armor --encrypt --recipient gp@ktln2.org <file>
$ gpg2 --decrypt <file>
@gipi
gipi / 000.md
Last active Dec 2, 2016
#ffmpeg
View 000.md
View questionario.md

Python 1

Una via quick'n'dirty e di convertire la list in un set e riconvertirlo in una list

>>> animali	=	["gatto",	"cane",	"pecora",	"gatto",	"bue",	"pecora",	"gatto"]
>>> list(set(animali))
['cane', 'pecora', 'gatto', 'bue']