Skip to content

Instantly share code, notes, and snippets.

View sanjayankur31's full-sized avatar

Ankur Sinha sanjayankur31

View GitHub Profile
@sanjayankur31
sanjayankur31 / install-latex-packages.sh
Last active April 15, 2019 11:37
Quick command to install LaTeX packages needed by a document on Fedora
# 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 December 28, 2017 11:00
Delete empty entries from timewarrior
# 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 October 5, 2017 09:46
Notes for the Fedora classroom - command line 101

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 November 16, 2016 23:24
Using SQL Developer off campus on Fedora 25 Linux

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

@sanjayankur31
sanjayankur31 / SimpleHTTPServerWithUpload.py
Created June 7, 2016 09:34 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/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.
"""
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 August 23, 2013 06:46
Get the ordering of groovy builds and update fedora.yaml
./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