This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
//Lets define a port we want to listen to | |
const PORT=8080; | |
//We need a function which handles requests and send response | |
function handleRequest(request, response){ | |
response.writeHead(200); | |
response.end('It Works!! Path Hit: ' + request.url); | |
console.log('It Works!! Path Hit: ' + request.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
: ${OVERRIDETHIS:="somedefault"} | |
echo ${OVERRIDETHIS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# -*- coding: utf-8 -*- | |
import json | |
import sys | |
import urllib2 | |
proxy = urllib2.ProxyHandler({ "http": "127.0.0.1:3128", "https": "127.0.0.1:3128" }) | |
jenkinsUrl = "http://labs-jenkins/jenkins/job/" | |
rocketUrl ="https://your-rocket.chat/hooks/sasdfafsa" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "hiredis.h" | |
// Shameless copy of example.c | |
// Depends on hiredis - download and make, drop this file on the hiredis folder and run | |
// gcc alvaro-redis.c libhiredis.a -o alvaro-redis -static | |
int main(int argc, char **argv) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
void bye(int sig); | |
int main( int argc, char *argv[] ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# run as follows: | |
# python SimpleHTTPServer.py | |
# then in your browser, visit: | |
# https://localhost:8443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
httpd = BaseHTTPServer.HTTPServer(('localhost', 8443), SimpleHTTPServer.SimpleHTTPRequestHandler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2007 John Hampton <[email protected]> | |
# All rights reserved. | |
# | |
# This software is licensed as described in the file COPYING, which | |
# you should have received as part of this distribution. | |
# | |
# Author: John Hampton <[email protected]> | |
# Extended: Branson Matheson <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p cropped | |
# parallel --eta convert {} -auto-orient -define jpeg:size=1920x1440 -resize 1920x1440 -crop 1920x1080+0+32 cropped/{} ::: *.JPG | |
for f in *.JPG | |
do | |
echo convert \"$f\" -auto-orient -define jpeg:size=1920x1440 -resize 1920x1440 -crop 1920x1080+0+32 cropped/\"$f\" | |
done | parallel --eta --will-cite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script: my-pi-temp.sh | |
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3 | |
# based of: Vivek Gite <www.cyberciti.biz> under GPL v2.x+ | |
# ------------------------------------------------------- | |
cpu=$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c1-2`)).$((`cat /sys/class/thermal/thermal_zone0/temp|cut -c3-4`)) | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "CPU => ${cpu}'C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adjust GPS tag on files in a folder | |
exiftool -GPSLongitudeRef=W -GPSLongitude="73.87538" -GPSLatitudeRef=N -GPSLatitude=40.850581 -ext cr2 jpg jpeg . | |
# Move files into Year/Month folders in a given folder | |
exiftool "-Directory<DateTimeOriginal" -d "%Y/%m" DIR | |
# Rename files in a folder using Year Month Day Hour Minute Second format | |
exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e DIR | |
exiftool -AllDates+=1 *.JPG | |
# Adjust file modification date | |
exiftool "-DateTimeOriginal>FileModifyDate" *.JPG | |
# Copy tags from another file |