Skip to content

Instantly share code, notes, and snippets.

View techgaun's full-sized avatar
🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])

Samar Dhwoj Acharya techgaun

🌌
Enum.random(["code", "sleep", "eat", "fifa", "soccer", "guitar", "board games"])
View GitHub Profile
@techgaun
techgaun / nginx-ssl-modern-cryptography.conf
Created August 25, 2015 10:39
An example nginx config with ssl using modern cryptography
server {
listen 443 ssl default;
ssl_certificate /etc/nginx/bundle.crt;
ssl_certificate_key /etc/nginx/privkey.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
@techgaun
techgaun / vim8.x_with_lua
Last active April 14, 2026 14:38
Install vim with lua support on ubuntu 16.04
I needed to install vim with lua support because I wanted to use neocomplete in my recently installed 15.04 distro. Also, this has python3 enabled by default.
Tested on 16.04 now
Update: This has been tested and verified to work on Ubuntu 16.04 as well. Also, if you wish to use particular branch/tag, you can get the version and then checkout appropriately.
The following (based upon https://gist.github.com/jdewit/9818870) should work though I copied it from history:
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.3-0 liblua5.3-dev python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
@techgaun
techgaun / s3-selected-bucket-policy.json
Created October 2, 2015 17:48
Allow S3 console access to single or selected bucket(s)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
@techgaun
techgaun / augeas-parse-network-scripts-ifcfg-team0-fix.md
Created October 10, 2015 18:59
Fix augeas parsing error for team0

Just quote TEAM_CONFIG with single quote instead of double quote

Error looks like below:

warning: augeas initialization had errors
please file a bug with the following lines in the bug report:
/augeas/files/etc/sysconfig/network-scripts/ifcfg-team0/error = "parse_failed"
/augeas/files/etc/sysconfig/network-scripts/ifcfg-team0/error/pos = "42"
/augeas/files/etc/sysconfig/network-scripts/ifcfg-team0/error/line = "4"
#!/usr/bin/perl -w
# Author: Konrad "morsik" Mosoń <mosonkonrad@gmail.com>
# linked here: http://wiki.libvirt.org/page/Networking#Applying_modifications_to_the_network
use strict;
use warnings;
my $net = $ARGV[0];
@techgaun
techgaun / deusi-re.txt
Last active January 27, 2016 14:25
deusi bhattaune
ए भन मेर भाई हो, देउसी रे !
ए राम्ररी भन, देउसी रे !
ए स्वोर मिलाई भन, देउसी रे !
ए यो घर कत्रो, देउसी रे !
सिंह दरबार जत्रो, देउसी रे !
यो आँगन कत्रो, देउसी रे !
टुँडिखेल जत्रो, देउसी रे !
हामी त्यसै, देउसी रे !
आएका हैनौँ, देउसी रे !
बली राजा ले, देउसी रे !
@techgaun
techgaun / tomcat.sh
Created March 8, 2016 02:58
Tomcat init script on CentOS box
#!/bin/bash
#
# description: Apache Tomcat init script
# processname: tomcat
# chkconfig: 234 20 80
#
#Location of JAVA_HOME (bin files)
export JAVA_HOME=/opt/java
@techgaun
techgaun / postgres.md
Last active June 10, 2016 18:58
Postgresql Notes

Get all the keys in jsonb fields

select distinct jsonb_object_keys(sfdata) from accounts;

Get values of given key that's more than 0 in jsonb field

select (sfdata-&gt;&gt;'BUILDING_SIZE__C')::float from accounts where (sfdata-&gt;&gt;'BUILDING_SIZE__C' = '') is false and cast(sfdata-&gt;&gt;'BUILDING_SIZE__C' as float) &gt; 0 limit 5;
@techgaun
techgaun / erlang-elixir-on-amazon-linux.md
Last active May 30, 2024 00:30
Running elixir 1.8.1 on amazon linux

Script

#!/bin/bash

yum install ncurses-devel openssl-devel -y
yum groupinstall "Development Tools" -y

cd /tmp
wget "http://erlang.org/download/otp_src_21.3.tar.gz" -O otp21.tar.gz
@techgaun
techgaun / influxdb-amazon-linux.md
Last active April 1, 2026 15:21
InfluxDB on Amazon Linux

Last updated: 2017-03-22 : Update to 1.2.2

The following assumes you're executing as a root user

Pre-install

yum update
yum install -y git
mkdir -p /opt/influx/{wal,data,ssl}