Skip to content

Instantly share code, notes, and snippets.

View thapakazi's full-sized avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
@thapakazi
thapakazi / nginxproxy.md
Created July 12, 2017 11:16 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@thapakazi
thapakazi / README.md
Created July 11, 2017 02:52 — forked from alexellis/README.md
Live Stream to YouTube from your RPi with Docker

Live Stream to YouTube from your RPi with Docker

Normally ffmpeg needed to stream to YouTube takes 8-9 hours to build on a PiZero. You can download my image here and run it with your secret key:

docker run --privileged -ti alexellis2/streaming:17-5-2017 <secret>

Bill of materials:

@thapakazi
thapakazi / git_create_orphan.sh
Created June 6, 2017 05:30 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@thapakazi
thapakazi / configure_docker0.sh
Created April 6, 2017 04:08 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/configure_docker0.sh | sudo bash -s - 192.168.254.1/24
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
## credit: http://fabian-affolter.ch/blog/the-lineinfile-module-of-ansible/
---
- hosts: alpine_install
user: root
tasks:
# - name: create a complete empty file
# command: /usr/bin/touch /test/test.conf
- name: create a new file with lineinfile
@thapakazi
thapakazi / postgres_table_row_count.sql
Created March 23, 2017 11:34
Row counts for all tables in a postgres db.
SELECT schemaname,relname,n_live_tup
FROM pg_stat_user_tables
ORDER BY n_live_tup DESC;
@thapakazi
thapakazi / cgroups.sh
Created January 8, 2017 08:50 — forked from arsham/cgroups.sh
Wroking with cgroups
# Taken from here: https://wiki.archlinux.org/index.php/cgroups
# You need: libcgroup and cgmanager apps.
# Then start the daemon:
sudo systemctl start cgmanager.service
# Creating the group
sudo cgcreate -a arsham:users -t arsham:users -g memory,cpu:GROUP_NAME
@thapakazi
thapakazi / gist:823ad2a1160af75876ea0ecb2c2ab78c
Created September 27, 2016 12:50 — forked from ipedrazas/gist:2c93f6e74737d1f8a791
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@thapakazi
thapakazi / mongodb_3.2.x_security.md
Created September 3, 2016 02:48 — forked from leommoore/mongodb_3.2.x_security.md
MongoDB 3.2.x Security

#MongoDB 3.2.x Security

##Network Ports The standard ports used by mongo are:

ProcessRoleDefault Port
@thapakazi
thapakazi / 20-synaptics.conf
Created May 16, 2016 18:47 — forked from Olical/20-synaptics.conf
Some configuration for Arch Linux on a Dell XPS 13 9350
Section "InputClass"
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "3"
Option "TapButton3" "2"
Option "VertEdgeScroll" "on"
Option "VertTwoFingerScroll" "on"
Option "HorizEdgeScroll" "on"