Skip to content

Instantly share code, notes, and snippets.

Avatar

Ankur Sinha sanjayankur31

View GitHub Profile
@sanjayankur31
sanjayankur31 / install-latex-packages.sh
Last active Apr 15, 2019
Quick command to install LaTeX packages needed by a document on Fedora
View install-latex-packages.sh
# Replace FILENAMES with the names of the files that include the packages
sudo dnf install $(grep -h "usepackage" FILENAMES | sed "s|\\\usepackage.*{|tex(|" | sed "s|}$|\.sty)|" | tr '\n' ' ') --setopt=strict=0
@sanjayankur31
sanjayankur31 / timew-delete-empty.sh
Last active Dec 28, 2017
Delete empty entries from timewarrior
View timew-delete-empty.sh
# Delete timewarrior entries that are less than a minute long.
# Beware - in this version, grep doesn't check the duration field here, so if you have a task that starts at 0:00, that'll be delete too!
for i in $(timew summary :ids | grep '0:00:..' | awk '{print $1}' | tr '\n' ' '); do timew delete $i; donefor i in $(timew summary :ids | grep 0:00:00 | awk '{print $1}' | tr '\n' ' '); do timew delete $i; done
# This one extracts the id and duration fields and then does the bit, so it's safer, but it's more complex.
# The last grep decides what must be deleted, so one can change the regex there as one wishes.
for entry in $(timew summary :ids | grep -o '@.*' | sed -E 's/(^@[[:digit:]]+)([[:alpha:]|[:punct:]|[:space:]]+)/\1 /' | sed -E 's/[[:space:]]{2,}/ /' | cut -d ' ' -f 1,4 | grep -E '[[:digit:]]{0,2}:0[01]:..' | cut -d ' ' -f 1 | tr '\n' ' '); do timew delete $entry; done
@sanjayankur31
sanjayankur31 / Fedora-Classroom-command-line-101.rst
Last active Oct 5, 2017
Notes for the Fedora classroom - command line 101
View Fedora-Classroom-command-line-101.rst

Fedora Classroom - Command Line 101

  • 1300 UTC, 10th August 2017
  • #fedora-classroom on Freenode
  • Pre-requisites: A linux system with any terminal emulator that runs bash
  • run sudo mandb

Introduction to the shell

@sanjayankur31
sanjayankur31 / sqldeveloper-fedora25.rst
Last active Nov 16, 2016
Using SQL Developer off campus on Fedora 25 Linux
View sqldeveloper-fedora25.rst

VPN access

In a terminal:

sudo openconnect --juniper uhvpn.herts.ac.uk

It'll ask for credentials. Staff will use: <your studynet id>@staff while students will use: <your studynet id>@student

View SimpleHTTPServerWithUpload.py
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
View gist:7379458
sudo yum -y install python-virtualenv
virtualenv my-venv
source my-venv/bin/activate
git clone url-for-bloom
cd bloom
python setup.py develop
./bin/bloom-generate
@sanjayankur31
sanjayankur31 / gist:6316228
Created Aug 23, 2013
Get the ordering of groovy builds and update fedora.yaml
View gist:6316228
./catkin/bin/catkin_topological_order --only-names | sort #alphabetical order
%s/\(.*\)/\1:\r fedora:\r [ros-groovy-\1]\r/ #vim command to complete yaml file