Skip to content

Instantly share code, notes, and snippets.

View illucent's full-sized avatar
🎯
Focusing

Andrew Starodubtsev illucent

🎯
Focusing
View GitHub Profile
@illucent
illucent / Python3 Virtualenv Setup
Created October 23, 2017 10:45 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3 Virtualenv
To install virtualenv via pip
$ pip3 install virtualenv
Note that virtualenv installs to the python3 directory. For me it's:
$ /usr/local/share/python3/virtualenv
Create a virtualenvs directory to store all virtual environments
$ mkdir somewhere/virtualenvs
Make a new virtual environment with no packages
@illucent
illucent / sniff.txt
Created September 8, 2017 23:03 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@illucent
illucent / kubernetes.md
Created August 2, 2017 21:11 — forked from carlessanagustin/kubernetes.md
Kubernetes tutorial steps

1. Create cluster

Cluster up and running

minikube version
minikube start
kubectl version
@illucent
illucent / connmanctl.md
Created July 18, 2017 09:22 — forked from kylemanna/connmanctl.md
Connmanctl Cheat Sheet

Using IFTTT to handle future and recurring tasks

  • Store the tasks in our "GFR Tasks" Google calendar.

    • Relatively fine grained control over dates of tasks (e.g. second Wednesday of each month)
  • IFTTT applet turns these events into cards in Trello

    • Our applets
    • "If any event starts on GFR Tasks, then create a card in - Go Free Range board"
    • Fires 15 minutes before the start date of a task, i.e. 23:45 for all day tasks
@illucent
illucent / gist:671a9c3727414c5fbdbb15a7983494dd
Created July 8, 2017 23:14 — forked from datagrok/gist:2199506
Virtualenv's `bin/activate` is Doing It Wrong

Virtualenv's bin/activate is Doing It Wrong

I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.

Virtualenv is a great tool on the whole but there is one glaring problem: the activate script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate script sets some environment variables in your current environment and defines for you a deactivate shell function which will (attempt to) help you to undo those changes later.

This pattern is abhorrently wrong and un-unix-y. activate should instead do what ssh-agent does, and launch a sub-shell or sub-command with a modified environment.

Problems

@illucent
illucent / uuid.sh
Created May 28, 2017 10:01 — forked from markusfisch/uuid.sh
Generate a random UUID in bash
#!/usr/bin/env bash
# Generate a pseudo UUID
uuid()
{
local N B C='89ab'
for (( N=0; N < 16; ++N ))
do
B=$(( $RANDOM%256 ))
@illucent
illucent / localStorage.js
Created May 18, 2017 12:03 — forked from anhang/localStorage.js
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@illucent
illucent / notitrans
Created March 19, 2017 17:15
python youdao-dict-api
#!/usr/bin/bash
word="$(xsel -o)"
result=$(youdao "$word")
notify-send --icon=info "$word" "$result"
@illucent
illucent / weather.py
Created March 16, 2017 16:54 — forked from jleclanche/weather.py
Quick python weather script using Google's Weather API
#!/usr/bin/env python
# encoding: utf-8
import sys
from argparse import ArgumentParser
from xml.dom import minidom
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError: