Skip to content

Instantly share code, notes, and snippets.

View shudarshon's full-sized avatar
🎯
Focusing

Shudarshon Chaki shudarshon

🎯
Focusing
View GitHub Profile
@chrischambers
chrischambers / gist:1154231
Created August 18, 2011 14:56
Summary, Networking Stuff

IP Addresses:

  • A bit is a BInary digiT. It uses base 2.
  • A byte is 8 bits.
  • An IPv4 address is 4 bytes (32 bits) long. It is usually expressed in decimal notation, i.e. 0-255.0-255.0-255.0-255.
  • IP addresses comprise 2 parts:
@tovbinm
tovbinm / crontab
Created February 22, 2012 01:10
Logrotate & upload nginx logfiles to s3://bucket/dt=..../hostname.log...gz
# Nginx - logrotate & upload to S3
0 0 * * * /usr/sbin/logrotate /etc/logrotate.d/nginx
15 0 * * * s3cmd put /var/log/nginx/access.log-`date +"\%Y\%m\%d"`.gz s3://$LOGS_BUCKET_NAME/nginx-access/`date +"dt=\%Y\%m\%d"`/`hostname -s`.access.log-`date +"\%Y\%m\%d"`.gz
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@akoumjian
akoumjian / salt_masterless_quickstart.rst
Created December 7, 2012 23:26
Salt Masterless Quickstart Guide

Salt Masterless Quickstart

Running a masterless salt-minion lets you use salt's configuration management for a single machine. It is also useful for testing out state trees before

@douglasduteil
douglasduteil / .travis.yml
Last active February 22, 2021 13:27 — forked from lukewpatterson/gist:4242707
Here is how I allow Git SSH authentication in Travis CI. I'm using it to connect Travis to my repo organization AngularUI. This trick is a fork. The goal is to encode the RSA private deploy key in the .travis.yml as "-secure: xxxxx.....".
---
language: node_js
node_js:
- '0.10'
branches:
only:
- master
before_script: .travis/before_script.sh
script: echo -e " >>> Do something... \"grunt\" for example\n"
after_success: .travis/after_success.sh
@gbl08ma
gbl08ma / tny
Created July 30, 2013 17:40
Unix shell script to shorten URLs with tny.im URL shortener. wget must be installed for this to work.
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo "usage: tny long_url [custom_keyword]"
echo ""
echo "Shorten URLs with tny.im URL shortener"
echo "This script expects a long URL to shorten either as an argument or passed through STDIN."
echo "When using arguments, an optional second argument can be provided to customize the later part of the short URL (keyword)."
exit 1
fi
@ryanhanwu
ryanhanwu / README.md
Last active June 17, 2019 14:28
Auto deployment script for CI with Git/Node.JS/Forever

Auto deployment script for CI with Git/Node.JS/Forever

Usage

1.Simply add the deploy.sh to your application folder

2.Start your service

deploy.sh start myApp.js
@thoroc
thoroc / gist:9970941
Last active December 24, 2017 17:57
A collection of Unix/Linux find command examples

source: http://alvinalexander.com/unix/edu/examples/find.shtml

basic 'find file' commands

find / -name foo.txt -type f -print             # full command
find / -name foo.txt -type f                    # -print isn't necessary
find / -name foo.txt                            # don't have to specify "type==file"
find . -name foo.txt                            # search under the current dir
@tristanfisher
tristanfisher / Ansible-Vault how-to.md
Last active April 3, 2024 13:55
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.