Skip to content

Instantly share code, notes, and snippets.

@gp187
gp187 / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@gp187
gp187 / nginx.conf
Created February 29, 2016 11:14 — forked from oroce/nginx.conf
nginx config for using grafana, elasticsearch and graphite with authentication.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
### Keybase proof
I hereby claim:
* I am Davidx7 on github.
* I am c3zar (https://keybase.io/c3zar) on keybase.
* I have a public key whose fingerprint is 814C 5CCF 901C C2A9 D877 00F9 07BF 57AE 8384 E40A
To claim this, I am signing this object:
@gp187
gp187 / install-letsencrypt-autorenew.sh
Created September 1, 2016 17:40
Install letsencrypt and automatically renew certificates monthly
#!/bin/bash
# Install: let's encrypt certbot
To use run ```install-letsencrypt-autorenew.sh example.com``` and everything will be done for you
function install() {
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
}
@gp187
gp187 / automake-aclocal-1.15-not-found-error-fix.sh
Last active September 2, 2016 10:41
aclocal-1.14 command not found error by compiling automake from source to get latest version
#
# You already have aclocal installed on your system, but it's aclocal-1.14
# Many compiles fail due to that, like OpenSSL, Luajit, etc
# Automake from source will fix that
#
VERSION=1.15
wget ftp://ftp.gnu.org/gnu/automake/automake-${VERSION}.tar.gz &> /dev/null
if [ -f "automake-${VERSION}.tar.gz" ]; then
tar -xzf automake-${VERSION}.tar.gz
@gp187
gp187 / lc_all-fix.sh
Created September 13, 2016 10:22
Fix LC_ALL = (unset) on AWS
#!/bin/bash
# run as root only
if [[ $EUID -ne 0 ]] ; then
echo "This script must be run with root access\e[49m"
exit 1
fi
echo LC_ALL="en_US.UTF-8" >> /etc/environment
locale-gen "en_US.UTF-8"
@gp187
gp187 / b.sh
Created October 3, 2016 17:23
Visual Studio Code 2015 Ubuntu 16 multi cursor
gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier "<Super>"
@gp187
gp187 / webstorm-phpstorm-inotify-fix
Last active June 13, 2023 08:56
Webstorm, PHPStorm Inotify watch limit is too low
To prevent this situation it is recommended to increase the watches limit (to, say, 512K):
1. Add the following line to either /etc/sysctl.conf file or a new *.conf file (e.g. idea.conf) under /etc/sysctl.d/ directory:
fs.inotify.max_user_watches = 524288
2. Then run this command to apply the change:
sudo sysctl -p --system
And don't forget to restart your IDE.
@gp187
gp187 / ubuntu16-disable-desktop-gui
Created February 1, 2017 09:56
OnStartup: no UI and No GUI. Just login screen for ubuntu 16
To boot to console:
`sudo systemctl set-default multi-user.target`
You must then edit /etc/default/grub by removing splash from the GRUB command line. (Remember to update GRUB afterward: sudo update-grub).
To get to the Unity desktop from the console, you must enter the command:
sudo systemctl start lightdm.service
@gp187
gp187 / currencies.json
Created February 9, 2017 12:32
All currencies in JSON -- Array of Objects
[{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
}, {
"symbol": "CA$",