linux
38 posts — page 2
-
wget file from google drive
Sometimes it is useful, even more if you have a chromebook, to upload a file to Google Drive and then use wget to retrieve it from a server remotely.
-
Compile healpix C++ to javascript
Compile C++ -> LLVM with clang Convert LLVM -> Javascript: https://github.com/kripken/emscripten/wiki/Tutorial
-
Ubuntu PPA for HEALPix and healpy
HEALPix C, C++ version 3.00 and healpy version 1.4.1 are now available in a PPA repository for Ubuntu 12.04 Precise and Ubuntu 12.10 Quantal.
-
Vim regular expressions
very good reference of the usage of regular expressions in VIM: http://www.softpanorama.org/Editors/Vimorama/vimregularexpressions.shtml
-
gnome alt f2 popup launcher
gnome alt f2 popup launcher
-
change permission recursively to folders only
change permission recursively to folders only
-
aptitude search 'and'
this is really something really annoying about aptitude, if you run: aptitude search linux headers it will make an 'or' search...to perform a 'and' search, which I need 99.9% of the time, you need quotation marks: aptitude search 'linux headers'
-
using numpy dtype with loadtxt
Let's say you want to read a text file like this: filename start end fdsafda.fits 23143214 23143214 safdsafafds.fits 21423 23423432 you can use dtype to create a custom array, which is very flexible as you can work by row or columns with strings and floats in the same array: dt=np.dtype({'names':['filename','start','end'],'formats':['S100',np.float,np.float]}) [I tried also using np.str instead of S100 without success, anyone knows why?] then give this as input to loadtxt to load the file and create the array.
-
execute bash script remotely with ssh
a bash script launched remotely via ssh does not load the environment, if this is an issue it is necessary to specify --login when calling bash: ssh user@remoteserver.com 'bash --login lifeom/cronodproc' | mail your@email.com -s cronodproc
-
lock pin hold a package using apt on ubuntu
set hold: echo packagename hold | dpkg --set-selections check, should be hi : dpkg -l packagename unset hold: echo packagename install | dpkg --set-selections
-
Latest Maxima and WxMaxima for Ubuntu Karmic
Note: The original third-party repository for Maxima packages is no longer available. On the maxima mailing lists they suggested to install the sbcl built, so I first installed sbcl from the Ubuntu repositories and then maxima and wxmaxima from the third-party repository.
-
number of files in a folder and subfolders
folders are not counted find . -type f | wc -l
-
forcefully unmount a disk partition
check which processes are accessing a partition: [sourcecode language="python"]lsof | grep '/opt'[/sourcecode] kill all the processes accessing the partition (check what you're killing, you could loose data): [sourcecode language="python"]fuser -km /mnt[/sourcecode] try to unmount now: [sourcecode language="python"]umo
-
netcat, quickly send binaries through network
just start nc in server mode on localhost: [sourcecode language='python'] nc -l -p 3333 [/sourcecode] send a string to localhost on port 3333: [sourcecode language='python'] echo "hello world" | nc localhost 3333 [/sourcecode] you'll see on server side appearing the string you sent.
-
Producing PDF from XML files
I need to produce formatted pdf from XML data input file. The more standard way looks like to use XSL stylesheets. Associating a XSL sheet to an XML file permits most browsers to render them directly as HMTL, this can be used for web publishing XML sheets.