Skip to content

Instantly share code, notes, and snippets.

server {
listen 80;
server_name localhost;
location / {
# Pass requests to ElasticSearch
proxy_pass http://localhost:9200;
proxy_redirect off;
@gbnk0
gbnk0 / package_updates_check.py
Created August 26, 2016 11:44 — forked from yumminhuang/package_updates_check.py
Python script to check apt-get updates
#!/usr/bin/env python
#coding=utf-8
import apt
import apt_pkg
from time import strftime
import os
import subprocess
import sys
@gbnk0
gbnk0 / detect_windows_version.ps1
Created May 25, 2016 14:50
Detect windows version powershell
# Detect windows version
if ([environment]::OSVersion.Version.Major -ge 6){
Write-Output "Win2008 or after"
}
@gbnk0
gbnk0 / cursor_animation.py
Created May 22, 2016 00:59 — forked from kholis/cursor_animation.py
Python Text Cursor Animation
#!/usr/bin/env python
# taken from: http://stackoverflow.com/questions/7039114/waiting-animation-in-command-prompt-python
import threading
import time
class CursorAnimation(threading.Thread):
def __init__(self):
self.flag = True
import time
from threading import Thread
def myfunc(i):
print "sleeping 5 sec from thread %d" % i
time.sleep(5)
print "finished sleeping from thread %d" % i
for i in range(10):
t = Thread(target=myfunc, args=(i,))
@gbnk0
gbnk0 / passgen.py
Created May 9, 2016 00:04 — forked from 0xPr0xy/passgen.py
password generator
from string import digits, ascii_letters
from random import choice
from sys import argv
def generator(length):
chac = digits + ascii_letters
pwd = list()
for p in range(length):
pwd.append(choice(chac))
print("".join(pwd))