Skip to content

Instantly share code, notes, and snippets.

@belano
belano / 40_custom
Last active July 25, 2018 15:19
Grub2 iso menu entries
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 8 UEFI" {
search --file --no-floppy --set=root /efi/Microsoft/Boot/bootmgfw.efi
chainloader (${root})/efi/Microsoft/Boot/bkpbootmgfw.efi
}
@belano
belano / docker-commands.md
Created March 29, 2017 13:46
Docker remove commands

Removing images

Remove one or more specific images

List:

docker images -a

Remove:

docker rmi Image Image
@belano
belano / client.ovpn
Created March 21, 2017 13:41
openvpn ubuntu dns nameserver
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
@belano
belano / chromedriver-install.sh
Last active March 20, 2017 14:11
selenium chromedriver install
LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip
unzip chromedriver_linux64.zip -d /usr/local/bin && rm chromedriver_linux64.zip
@belano
belano / README.md
Created February 17, 2017 16:54 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications you can follow me @leonardofed


@belano
belano / JodaParamConverterProvider.java
Created May 11, 2016 07:45
Jersey Joda parameter converter provider
package com.belano;
import static java.lang.String.format;
import static org.joda.time.format.ISODateTimeFormat.date;
import static org.joda.time.format.ISODateTimeFormat.dateTime;
import static org.joda.time.format.ISODateTimeFormat.dateTimeNoMillis;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
@belano
belano / start-container.sh
Last active May 3, 2016 14:55
Helper script for (re)starting a docker container
#!/bin/bash
function getStatus(){
CONTAINER_ID=$(docker ps -a | grep -v Exit | grep $1 | awk '{print $1}')
if [[ -z $CONTAINER_ID ]] ; then
echo 'Not running.'
return 1
else
echo "Running in container: $CONTAINER_ID"
return 0
@belano
belano / Network.java
Created February 15, 2016 14:26
Allocate free port from an ephemeral port range
import java.io.IOException;
import java.net.ServerSocket;
public final class Network {
private Network() {
// Do nothing.
}
public static int findFreePort() {
@belano
belano / elasticsearch-reindex.py
Created November 26, 2015 16:07
Elasticsearch reindex data with zero downtime
#!/usr/bin/env python
'''
Lots taken from http://codereview.stackexchange.com/q/56979
'''
from argparse import ArgumentParser, FileType
import requests
import json
import os, sys
@belano
belano / android.sh
Created February 11, 2015 16:27
/etc/profile.d/android.sh
export ANDROID_HOME=$HOME/apps/adt-bundle-linux-x86_64-20130219/sdk
export ANDROID_NDK_HOME=$HOME/apps/adt-bundle-linux-x86_64-20130219/ndk
export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH