Skip to content

Instantly share code, notes, and snippets.

View minhng99's full-sized avatar
🤖
Making the world a better place, one bit at a time!

Nguyen Quang Minh minhng99

🤖
Making the world a better place, one bit at a time!
View GitHub Profile
@ngcrawford
ngcrawford / multiprocessing_template.py
Created March 29, 2012 12:49
Template for multiprocessing large files line by line
#!/usr/bin/env python
# encoding: utf-8
import multiprocessing
from textwrap import dedent
from itertools import izip_longest
def process_chunk(d):
"""Replace this with your own function
that processes data one line at a
@guskuete
guskuete / Download vios_l2-adventerprisek9-m.03.2017.qcow2
Last active December 30, 2022 11:35
To download vios_l2-adventerprisek9-m.03.2017.qcow2, use the link bilow.
https://1drv.ms/u/s!AlN1V2_cNJ1Un1C10Ix36trEuQba?e=II3EG8
@col
col / servo_test.ino
Created December 29, 2013 13:18
A simple Arduino sketch that allows you to control a brushless motor via an ESC (or any servo really) using inputs from the Arduino IDE serial monitor.
#include <Servo.h>
Servo esc;
int escPin = 9;
int minPulseRate = 1000;
int maxPulseRate = 2000;
int throttleChangeDelay = 100;
void setup() {
» city
» country
nginx city:"San Diego" country:US
» geo
Devices within a 50km radius of San Diego (32.8,-117): geo:32.8,-117,50
» hostname
"Server: gws" hostname:google
» net
net:216.219.0.0/16
» os
@braian87b
braian87b / openwrt-lede-openvpn-client.md
Last active April 2, 2021 09:33
Setting an OpenWrt / LEDE Based Router as OpenVPN Client

These instructions should work for Streisand as well for others VPN providers (Streisand is a Software that automatically configures a VPS online server with OpenVPN and other VPN/Proxy Softwares in order to have a private VPN Server)

These instructions are for getting an OpenWrt Based Router working as OpenVPN Client (should work for LEDE, Gargoyle and another distributions). Computers connected to Lan Ports of the OpenWrt Router will navigate through the Internet connection of the OpenVPN Server (in this case the Streisand one previously set up) you need a working Router with OpenWrt based firmware flashed on it (LEDE or eko.one.pl could also work) steps works well on Chaos Calmer 15.05 or 15.05.1.

  1. You need to telnet 192.168.1.1 (OpenWrt Router) and set up a password using passwd You can skip this if you already have a password and can connect using ssh.
@antonioaguilar
antonioaguilar / scaleway-virtualbox-install.sh
Last active May 7, 2020 07:24 — forked from fabianmu/gist:3467a28e274f03fd9dfe20b2a6f7feca
Install Virtualbox 5.2 on Scaleway (works with Scaleway kernel 4.4.127-mainline-rev1 Ubuntu Xenial - June 2018)
alias wget='wget -q --no-check-certificate'
# so that we can install virtualbox via apt-get
for x in xenial xenial-security xenial-updates; do
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src http://archive.ubuntu.com/ubuntu ${x} main universe" | tee -a /etc/apt/sources.list
done
echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | tee -a /etc/apt/sources.list.d/virtualbox.list
wget https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add -
apt-get update
@shakalaca
shakalaca / gist:4942cfb8a4869325cdc9
Last active November 6, 2019 07:29
Howto: compile mkbootimg/mkbootfs/make_ext4fs on OS X
mkdir source
mkdir bin
# clone source
cd source
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/libselinux
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/core
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/external/zlib
git clone --branch android-4.3_r3 https://android.googlesource.com/platform/system/extras
@m1tk4
m1tk4 / autologin-tty-centos6.md
Last active January 10, 2019 14:54
Creating a TTY on Centos6 with Automatic Login

Automatic Login TTY on Centos 6

  1. Copy /etc/init/tty.conf to /etc/init/tty-autologin.conf and edit the new file as follows ("myuser" is the user we want to end up logged in automatically on TTY1):
# tty - getty
#
# This service maintains a getty on the specified device.
#
# Do not edit this file directly. If you want to change the behaviour,
# please create a file tty.override and put your changes there.
@colby
colby / battery.sh
Last active December 17, 2017 10:05
A bash script for getting the laptop battery percentage for tmux.
#!/bin/bash
#
# To include the line below into your .tmux.conf to see battery % or charging icon.
# set -g status-right "#(/Users/colbyolson/src/scripts/battery.sh) #H %H:%M"
ok_color="colour236"
warn_percent="20"
warn_color="colour208"
status=$(pmset -g batt)