Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / vm-resize-hard-disk.md
Created December 1, 2018 10:15 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@tuxfight3r
tuxfight3r / gist:5d05b058a8c5204b9549c6246d431ceb
Last active July 20, 2018 00:26 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos/7
$ vagrant up
$ vagrant ssh
vagrantup:~$ sudo yum -y install wget kernel-devel kernel-headers gcc
vagrantup:~$ sudo yum -y update & reboot
vagrantup:~$ sudo wget -c http://download.virtualbox.org/virtualbox/5.2.12/VBoxGuestAdditions_5.2.12.iso \
-O VBoxGuestAdditions_5.2.12.iso
@tuxfight3r
tuxfight3r / one-liners.md
Created March 12, 2018 01:05 — forked from KL-7/one-liners.md
Ruby one-liners

One-liners

Reverse every line:

Input file:

$ cat foo
qwe
123

bar

@tuxfight3r
tuxfight3r / perl-one-liners
Created March 12, 2018 00:49
Perl One-Liners
Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10
-------------------------------- ----------- ------------
Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter)
http://www.catonmat.net -- good coders code, great reuse
Latest version of this file is always at:
http://www.catonmat.net/download/perl1line.txt
@tuxfight3r
tuxfight3r / 0pydmesg.py
Last active February 7, 2018 13:13 — forked from dopuskh3/pydmesg
python / bash based dmesg human readable timestamps
#!/usr/bin/env python
# coding=utf8
# Took from https://gist.github.com/542780 and fixed regex.
#
# Copyright (C) 2010 Saúl ibarra Corretgé <saghul@gmail.com>
#
"""
pydmesg: dmesg with human-readable timestamps
"""
@tuxfight3r
tuxfight3r / .credentials
Created December 7, 2017 17:09 — forked from vrischmann/.credentials
Running SBT with a Nexus proxy with authentication
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123
@tuxfight3r
tuxfight3r / openshift-cheatsheet.md
Created November 10, 2017 17:41 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet
  • Binary Builds
oc new-build --binary=true --name=ola2 --image-stream=redhat-openjdk18-openshift
oc start-build ola2 --from-file=./target/ola.jar --follow
oc new-app 
  • Turn off/on DC triggers to do a batch of changes without spam many deployments
@tuxfight3r
tuxfight3r / git-recover-branch.md
Created October 24, 2017 10:15 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@tuxfight3r
tuxfight3r / dhcpd.conf
Created February 1, 2017 16:43 — forked from tomoconnor/dhcpd.conf
snippet to show usage of dhcp-event (don't forget to set apparmor to allowing (complain) mode)
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;
on commit {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientMac = binary-to-ascii(16, 8, ":", substring(hardware, 1, 6));
log(concat("Commit: IP: ", ClientIP, " Mac: ", ClientMac, "Hostname: ", host-decl-name));
execute("/usr/local/bin/dhcp-event", "commit", ClientIP, ClientMac, host-decl-name);
}
@tuxfight3r
tuxfight3r / olympic_medals_scraper.py
Created January 19, 2017 15:05 — forked from schwartzmx/olympic_medals_scraper.py
Simple script to scrape the default grid Olympic medals table on NBC's site and dump the result as JSON
from bs4 import BeautifulSoup
import requests as r
from json import dumps
class Country:
def __init__(self, country, place, gold, silver, bronze, total_medals):
self.country = country
self.place = place
self.gold = gold
self.silver = silver