Skip to content

Instantly share code, notes, and snippets.

View payamohajeri's full-sized avatar
:octocat:

Payam Mohajeri payamohajeri

:octocat:
View GitHub Profile
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
@payamohajeri
payamohajeri / nginxproxy.md
Created December 27, 2016 23:12 — 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

@payamohajeri
payamohajeri / beanstalk.bash
Created June 16, 2016 09:33
Kick beanstalk jobs
for tube in "default" "review" "mail" "2/images" "1/images"; do echo -e "use $tube\r\nkick 1000\r\n" | nc 10.0.0.4 11300; done;
@payamohajeri
payamohajeri / mysql.bash
Last active December 13, 2017 19:09
MySQL Handbook
watch -d "mysql -u root -e 'SHOW PROCESSLIST'"
mysql -u root -e "SHOW PROCESSLIST" | grep -i "select" | grep -i "Queue" | cut -f 1 | nl -s "kill " | cut -c7- | sed -e 's/$/;/'
@payamohajeri
payamohajeri / introrx.md
Created May 29, 2016 05:25 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing