Skip to content

Instantly share code, notes, and snippets.

@arcaduf
arcaduf / Recursive search in subfolders
Last active March 8, 2019 15:48
Recursive search in subfolders
find path/ -name 'string'
@arcaduf
arcaduf / Work with Anaconda @Tomcat
Last active March 8, 2019 15:49
Work with Anaconda @TOMCAT
Connect to the beamline: 'ssh -X arcadu_f@x02da-gw'.
Connect to a specific machine: 'ssh -X e14236@x02da-gws-3'.
Type: 'export PATH=/opt/psi/Programming/psi-python27/2.3.0/bin:$PATH'.
Type: 'export CONDARC=/afs/psi.ch/project/TOMCAT_pipeline/Anaconda/.condarc_py27ana230'.
Check that you have loaded the Anaconda python: 'which python'.
The result should be: '/opt/psi/Programming/psi-python27/2.3.0/bin/python'.
If you want to create a new environment/install additional packages/delete an environment, get an AFS token with: 'klog -principal afs_username'.
If you want to list the already existing environments, type: 'conda env list'.
Load the environment you like, in our case, 'iter-rec' is ok: 'source activate iter-rec'.
To install additional packages to a specific environment, type 'conda install -name env-name package'.
@arcaduf
arcaduf / gist:57e36f4e767c2b643be9ea4cd021614f
Created March 13, 2017 20:27
Fixing Ubuntu stall at login after bad CUDA installation
Sometimes installing CUDA on Ubuntu turns out to be a huge broom in the ass.
One of the most common issue is that once you login after rebooting Ubuntu
is stalled.
To fix this problem, it is necessary to go on one TTY (e.g. Ctrl+Alt+F1),
login with username (with administrator rights) and password and try one of
the following procedures.
Trial #2 worked with me, in the sense that I could normally login in Ubuntu,
@arcaduf
arcaduf / gist:53c8527b47752d3888dabe1d4b9012bd
Last active March 13, 2017 21:12
See from terminal what is your Ubuntu / kernel / graphic card / glibc version
Ubuntu version:
$ lsb_release -a
Kernel version:
$uname -a
Graphic card:
$lspci | grep VGA
GLIBC:
@arcaduf
arcaduf / gist:ae0f7374b83de360be971946c5d1ad37
Created March 15, 2017 09:52
Eliminate update repo that always fails
The annoying update repo that always fails can be found inside the folder:
"/etc/apt/sources.list.d"
Just delete your entry of interest and get your retribution.
@arcaduf
arcaduf / gist:377e6a329e847b4cf2aeed051780b474
Created March 15, 2017 15:25
Installing nolearn for Anaconda environment
conda install -c toli nolearn=0.6a.toli
@arcaduf
arcaduf / gist:195309a44ace07ffefb8078b07e75b33
Created April 5, 2017 08:57
Double Boot Windows 8 & Ubuntu 14
Install Windows 8.1 from either USB or CD.
Install Ubuntu from either USB or CD. Choose the option: "Install alongside Windows 8".
When you reboot probably Windows will start automatically without asking if you want yo use Ubuntu.
In that case, use once again the USB/CD installer for Ubuntu and select the option "Try Ubuntu".
Open a terminal and type: "sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update"
Then type: "sudo apt-get install -y boot-repair && boot-repair"
The window of boot repair will pop up, select: "Recommended repair".
Once, boot repair has finished, just reboot, hopefully it did work.
@arcaduf
arcaduf / PDFTK: extract pages in a certain range or specific pages
Last active June 19, 2018 01:07
PDFTK: extract pages in a certain range or specific pages
pdftk A=in.pdf cat A1-10 A15 A17 output out.pdf
@arcaduf
arcaduf / Inkscape Latex: install textext extension
Last active September 6, 2017 10:24
Inkscape Latex: install textext extension
Download textext package
Unpack it and copy the .inc and .py file into ~/.config/inkscape/extensions/
Type: "sudo chmod 777 ~/.config/inkscape/extensions/textext.inx"
Type: "sudo chmod 777 ~/.config/inkscape/extensions/textext.inc"
@arcaduf
arcaduf / Installing CUDA on Ubuntu 16.04
Last active September 6, 2017 10:24
Installing CUDA on Ubuntu 16.04
Chech whether your gcc and g++ are the right version, i.e. version 5.
Go to "Software and Updates", then "Additional Drivers"; select NVIDIA drivers 375; install and restart.
Download the CUDA toolkit 8.0 from the official website.
Run the .run file accepting everything except the installation of the NVIDIA drivers, which already exist.
Go to the sample folder; run "make" and try the "matrixMul" script.