Skip to content

Instantly share code, notes, and snippets.

View louiscklaw's full-sized avatar
😀
life finds a way ... LEARN !!!

Louis Law, louiscklaw louiscklaw

😀
life finds a way ... LEARN !!!
View GitHub Profile
@louiscklaw
louiscklaw / echoserver.py
Created December 9, 2016 05:35 — forked from madssj/echoserver.py
A simple python echo server.
import asyncore
import asynchat
import socket
class Lobby(object):
def __init__(self):
self.clients = set()
def leave(self, client):
self.clients.remove(client)
= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
#!/bin/bash
# options:
# remove stopped containers and untagged images
# $ dkcleanup
# remove all stopped|running containers and untagged images
# $ dkcleanup --reset
# remove containers|images|tags matching {repository|image|repository\image|tag|image:tag}
# pattern and untagged images
# $ dkcleanup --purge {image}
## for ubuntu
sudo apt-get remove docker docker-engine
sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
sudo apt-get install \
apt-transport-https \
#! /usr/bin/env python
import logging
"""
I never remember all the steps for setting up logging in python.
This gist goes through the steps so I can copy and paste what I need.
"""
# create logger on the current module and set its level
logger = logging.getLogger(__file__)
@louiscklaw
louiscklaw / .gitattributes
Created July 31, 2017 02:29
general .gitattributes
# Auto detect text files and perform LF normalization
*.scss linguist-language=Vue
*.css linguist-language=Vue
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
# pip2 install hashlib pwgen
function ztransfer() {
python2 $argv[0] -c '\
import sys, subprocess, hashlib;\
BLOCKSIZE = 65536;\
hasher = hashlib.sha1();\
sTarget = sys.argv[1];\
sTarget7z = "%s.7z" % sTarget;\
from pwgen import pwgen;\
sUnzipPassword=pwgen(50, 1, symbols=False, capitalize=False);\

Keybase proof

I hereby claim:

  • I am louiscklaw on github.
  • I am louiscklaw (https://keybase.io/louiscklaw) on keybase.
  • I have a public key ASAvc7EmT1XUsffT20DYD9sAb45JJDVwVxSZgaVznSRfngo

To claim this, I am signing this object:

brew isntall Alfred
git config --global credential.helper 'cache --timeout=3600'