This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since I could not find any official support, putting what worked for me here. | |
How to get USB tethering on MAC working ! | |
0. connect your android phone by usb to your mac | |
1. install latest package from http://joshuawise.com/horndis | |
2. open terminal and run this command : sudo kextload /Library/Extensions/HoRNDIS.kext | |
3. disable USB debugging on your phone | |
4. check network (your phone should show up there now) and turn off wifi | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
check_process() { | |
echo "$ts: checking $1" | |
[ "$1" = "" ] && return 0 | |
[ `pgrep -n $1` ] && return 1 || return 0 | |
} | |
ts=`date +%T` | |
echo '$ts: stopping apache gracefully' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -n $'#####################################################\n' | |
echo -n $'### Find all git branches merged into this branch ###\n' | |
echo -n $'#####################################################\n' | |
response= | |
echo -n $'\nEnter name of the git branch > ' | |
read response | |
if [ -n "$response" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from -> https://stackoverflow.com/a/30394237/1035818 | |
# i hunt for this every once in a while, so creating the gist, all credits for this snippet at to the commenter from the link above | |
import logging | |
from django.db import connection | |
connection.force_debug_cursor = True # Change to use_debug_cursor in django < 1.8 | |
l = logging.getLogger('django.db.backends') | |
l.setLevel(logging.DEBUG) | |
l.addHandler(logging.StreamHandler()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: To merge current git branch into a branch called 'dev' and be back to the current branch | |
# ./git_merger.sh dev | |
target="$1" | |
current=`git branch | awk '/\*/{print $2}'` | |
git checkout ${target} | |
git pull origin ${target} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# OBJECTIVE | |
# 1. script should be able to pick up from where it left off, assume that state is saved extrenally in some datastore | |
# 2. order of execution of methods matters | |
class statefulDispatcherUsingChaining(): | |
def __init__(self, current_state=None): | |
self.current_state = "one" if not current_state else current_state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import requests | |
import json | |
import argparse | |
PAGE_LENGTH = '50' | |
PR_STATE = 'OPEN' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@f827ea48f84f:/code# ffmpeg -h full | |
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers | |
built with gcc 7 (Ubuntu 7.3.0-16ubuntu2) | |
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested on ubuntu-18 and mac os x (mojave) | |
# I also tried the ssh compressed way of doing things, but this is much simpler | |
# There might be better combinations available, please leave a comment and I shall test and update this gist | |
rsync -vaHxPz username@IP:SOURCE_PATH DESTINATION_PATH | |
# rsync options explanation: | |
# -v, --verbose increase verbosity | |
# -a, --archive archive mode; same as -rlptgoD (no -H) | |
# --no-OPTION turn off an implied OPTION (e.g. --no-D) |
OlderNewer