Skip to content

Instantly share code, notes, and snippets.

View mancubus77's full-sized avatar
🇦🇺

Mancubus mancubus77

🇦🇺
  • Just a small software company
  • Ku-ring-gai
View GitHub Profile
# enable admin access to clusdter
oadm policy add-cluster-role-to-user cluster-admin admin --config=/etc/origin/master/admin.kubeconfig
# give rights to container
oadm policy add-scc-to-user anyuid -z default
@mancubus77
mancubus77 / elasticsearch-cheatsheet.txt
Last active July 29, 2017 07:39 — forked from stephen-puiszis/elasticsearch-cheatsheet.txt
Elasticsearch Cheatsheet - An Overview of Commonly Used Elasticsearch API Endpoints and What They Do
# Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands
# Bulk actions:
# Delete all indexes via pattern
for index in $(curl -XGET esmaster:9200/_cat/indices | awk ‘/pattern/ {print $3}’); do curl -XDELETE esmaster:9200/$index?master_timeout=120s; done
# cat paths
/_cat/allocation
@mancubus77
mancubus77 / gist:c52959b7d2138512c8b2c8ce4f8224e1
Created July 23, 2017 11:05
godoc installation in ubuntu
sudo apt-get install golang-go.tools
https://stackoverflow.com/questions/17000548/how-to-make-godoc-command-work-on-my-system/23573335#23573335
@mancubus77
mancubus77 / gist:8d8e7009682094a5bfc5ba044c439f69
Created June 28, 2017 23:16
run unetbootin in LXDE or XFCE
sudo QT_X11_NO_MITSHM=1 unetbootin
@mancubus77
mancubus77 / gist:9b68256c2774c04289dec922570b5a62
Created June 19, 2017 01:00
How to pass corporate proxy
From here:
https://www.howtoforge.com/linux-ntlm-authentication-proxy-isa-server-with-cntlm
About Cntlm proxy
Quoted from the official ctnlm sourceforge.net Website: "Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy intended to help you break free from the chains of Microsoft proprietary world. You can use a free OS and honor our noble idea, but you can't hide. Once you're behind those cold steel bars of a corporate proxy server requiring NTLM authentication, you're done with. The same even applies to 3rd party Windows applications, which don't support NTLM natively.
.
Here comes Cntlm. It stands between your applications and the corporate proxy, adding NTLM authentication on-the-fly. You can specify several "parent" proxies and Cntlm will try one after another until one works. All auth'd connections are cached and reused to achieve high efficiency. Just point your apps proxy settings at Cntlm, fill in cntlm.conf (cntlm.ini) and you're ready to do. This is useful on Windows, but
@mancubus77
mancubus77 / gist:755aee82d74cce75dd6272998f7859d6
Last active June 8, 2017 00:20
How to create animated GIF images of a screencast?
simgle command:
mplayer -ao null out.ogv -vo jpeg:outdir=output && convert output/* output.gif && convert output.gif -fuzz 10% -layers Optimize optimised.gif
from
https://askubuntu.com/questions/107726/how-to-create-animated-gif-images-of-a-screencast
First install this:
<!DOCTYPE html>
<style>
.axis .domain {
display: none;
}
.text {
fill: black;
font-family: sans-serif
@mancubus77
mancubus77 / README
Created May 9, 2017 00:56 — forked from adilapapaya/README
Export Table Data to CSV using Javascript
Example code for exporting data in a table to a csv file.
# clear cache memory from cli
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
# crontab
*/15 * * * * root sync && echo 3 > /proc/sys/vm/drop_caches
Q: How to provide Internet access to servers restricted via firewall rules?
A: Use SSH Tunnel and iptables
Create SSH tunnel to remote host
ssh -R9000:127.0.0.1:1025 <username>@<remote_server>
This command will listen port 9000 on remote machine (ssh server) and forward all packets via ssh tunnel to port 1025 on client machine (ssh client).
So the tunnel is done, but we need to make traffic pipeline. Let's configure our remote server which is located in well protected intranet. We need to forward all HTTP (or any other?) traffic on originated on remote server to the SSH tunnel. There are several ways to do this: