Skip to content

Instantly share code, notes, and snippets.

@miztiik
miztiik / utserver.conf
Last active August 26, 2015 03:58
Configuration settings template for μTorrent for Linux. Taken from μTorrent Server manual for version alpha-3.3. - Ref - http://forum.utorrent.com/topic/73370-sample-utserverconfig-file/
##
## utserver.conf
## Configuration settings template for μTorrent for Linux.
## Taken from μTorrent Server manual for version alpha-3.3.
## ©2013 BitTorrent, Inc.
## Compiled by Rich.T.
##
##
## Command-line Arguments
@miztiik
miztiik / bash.generate.random.alphanumeric.string.sh
Last active August 29, 2015 14:27 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
function genStringPatterns() {
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
<NotepadPlus>
<UserLang name="Markdown" ext="md markdown" udlVersion="2.0">
<!-- Modified by Edditoria, originally created by thomsmits @ git,
see https://github.com/Edditoria/markdown_npp_zenburn for latest version -->
<Settings>
<Global caseIgnored="yes" forceLineCommentsAtBOL="yes" />
<Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" />
</Settings>
<KeywordLists>
<Keywords name="Comments" id="0">00# 01 02 03&lt;!-- 04--&gt;</Keywords>
@miztiik
miztiik / Install-Docker&-Compose
Created February 24, 2016 19:10
Quick set of commands to install docker & compose in one go
curl -fsSL https://get.docker.com/ | sh && \
service docker start && \
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose
@miztiik
miztiik / fetchMetadata.py
Created August 23, 2016 06:51
AWS Lamda experiment to fetch media metadata from OMDB using their API
def lambda_handler(event, context):
import requests, json
r = requests.get('http://www.omdbapi.com/?t=titanic&y=1997&plot=short&r=json')
mediaMetadata = r.json()
print json.dumps( mediaMetadata, indent=4, sort_keys=True )
return {json.dumps( mediaMetadata, indent=4, sort_keys=True )}
@miztiik
miztiik / chef-workstation-quick-setup.sh
Last active August 30, 2016 05:37
chef-workstation-quick-setup.sh
yum install deltarpm wget unzip python-pip -y
cd /tmp
wget https://github.com/miztiik/Learn-Chef/blob/master/init/init.zip?raw=true -O init.zip
mv init.zip /
cd /
unzip init.zip
cd /chef-repo
# curl -L https://www.opscode.com/chef/install.sh | bash
curl -L https://www.opscode.com/chef/install.sh | bash -s -v 12.13.30 && rm install.sh
service chef-client restart
CREATE DATABASE moovydb;
USE moovydb;
GRANT ALL ON moovydb.* TO moovydbuser@localhost IDENTIFIED BY 'YOUR_COMPLICATED_DIFFICULT_TO_REMEMBER_PASSWORD_GOES_HERE';
CREATE TABLE IF NOT EXISTS moviestable (
year int(4) NOT NULL,
month varchar(3) NOT NULL,
day int(2) NOT NULL,
movietitle varchar(250) DEFAULT NULL,
@miztiik
miztiik / sendTestEmail.sh
Created December 6, 2016 10:53
send an test email from sendmail
#!/bin/bash
#set -x
scriptName="$(basename $0)"
scriptUSAGE="$scriptName <johndoe@example.com>"
if [[ $# -eq 0 ]]; then
echo "No arguments supplied"
echo $scriptUSAGE
@miztiik
miztiik / gist:551fe97118c23c265c698186f50f20dc
Last active January 6, 2017 10:46 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
# cURL
```sh
curl -o destination FILE://source
```
# rsync
```sh
rsync -ah --progress source-file destination
```