Skip to content

Instantly share code, notes, and snippets.

@tuxdna
tuxdna / README.md
Last active March 10, 2023 13:02
Git clone without deep history

Git references

Git clone without deep history

Git clone without deep history make cloning faster when we only need the latest code.

With full history

First run

@opyate
opyate / commit-msg
Created October 10, 2017 09:33
JIRA code commit msg hook; presumes merges happen on remote (via PR mechanism, etc)
#!/bin/sh
# .git/hooks/commit-msg
test "" != "$(egrep '[A-Z]{3,}-\d+' "$1")" || {
echo >&2 Commit message requires JIRA code.
exit 1
}
@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active October 22, 2022 14:03
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@hayd
hayd / sns-to-slack.py
Created May 5, 2016 06:47
sns to slack aws lambda python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Follow these steps to configure the webhook in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Incoming WebHooks".
@asmacdo
asmacdo / main.yml
Created August 1, 2014 14:47
Create multiple directories with ansible
- name: Make sure the sites-available, sites-enabled and conf.d directories exist
file:
path: "{{nginx_dir}}/{{item}}"
owner: root
group: root
mode: 0755
recurse: yes
state: directory
with_items: ["sites-available", "sites-enabled", "conf.d"]
@thimbl
thimbl / script.sh
Created March 19, 2011 00:43
shell script to create user accounts
#!/bin/bash
ROOT_UID=0
SUCCESS=0
E_USEREXISTS=70
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
if [ "$UID" -ne "$ROOT_UID" ]
then
echo "Must be root to run this script."
exit $E_NOTROOT