Skip to content

Instantly share code, notes, and snippets.

View surhudm's full-sized avatar

Surhud More surhudm

View GitHub Profile
@surhudm
surhudm / gist:54675a6103bc2780f0c1
Created March 22, 2015 01:32
Serve sphinx documentation for git repository on gh-pages
#!/bin/bash
: '
This gist describes how to serve sphinx documentation
for a code already existing on git using gh-pages
'
: '
First install pip
'
pip install --upgrade sphinx
import pylab as pl
import numpy as np
a = np.arange(10)
%pylab inline
ax=pl.subplot(111)
ax.plot(a,a)
@surhudm
surhudm / user_friendly_fedora_t460s.sh
Last active July 5, 2019 19:29
Make Fedora usable on Lenovo T460s
# Please read everything below carefully, and do not blindly run it.
# Install gnome-tweak-tool and change fonts in Fonts section to
# change scaling factor 1.25 or directly from command line:
gsettings set org.gnome.desktop.interface text-scaling-factor 1.25
# Adjust which fonts you want below:
# gsettings set org.gnome.desktop.wm.preferences titlebar-font 'Font fontsize'
# gsettings set org.gnome.desktop.interface monospace-font-name 'Font fontsize'
# gsettings set org.gnome.desktop.interface font-name 'Font fontsize'
For linux:
Install python-pyside using your system package manager
bash $ sudo apt install python-pyside
Or
bash $ sudo dnf install python-pyside
If you do not have root permissions, even the following may work
@surhudm
surhudm / getdist.md
Last active April 24, 2017 01:05
GetDist setup procedure

Installing blind version of getdist

Here is the procedure to install the blind version of getdist from my fork to your computer.

On your command line type:

pip install --user git+https://github.com/surhudm/getdist.git@53aa798b228
@surhudm
surhudm / GNUPG.md
Last active May 25, 2017 21:43
gpg key creation

Creating the public/private key pair (For the blinder)

gpg --gen-key

Choose the default options for the following first three questions

What kind of key? RSA and RSA

@surhudm
surhudm / GNUPG_agent_forwarding.md
Last active February 18, 2022 17:50
GNUPG agent forwarding

Forward GNUPG agent with the following steps:

On the remote insecure machine:

Run gpg once to create the directory structure.

gpg --list-keys

On the local machine:

@surhudm
surhudm / vnc.md
Last active May 17, 2020 14:40
Setup vnc

Setup vnc

Setup ssh

First of all in .ssh/config, create an entry:

host shortnamevnc
    hostname the_url_of_server
    localforward 12345 localhost:5901
 identityfile ~/.ssh/id_rsa
@surhudm
surhudm / linux.md
Last active June 13, 2019 11:53
Useful linux commands

Useful linux commands:

# List files in directory
ls -lrt

# Show contents of file
cat filename

# Useful to parse lines
@surhudm
surhudm / mpi.md
Last active June 13, 2019 12:02
A simple mpi python program

A simple mpi program which outputs the rank and size of the MPI pool.

Save the following program as say test.py.

#!/usr/bin/env python
from mpi4py import MPI
from subprocess import call

comm = MPI.COMM_WORLD