Skip to content

Instantly share code, notes, and snippets.

View Teino1978-Corp's full-sized avatar

Teino Boswell Teino1978-Corp

  • Ocho Rios, Jamaica
View GitHub Profile
from __future__ import print_function #from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import http.server, urllib, datetime, json
#=================================================================
sUrl="/testServer" #server url
port=8000 #server port
#=================================================================
# data
#=================================================================
jsonDict = {
"login" : { # sent at login
@Teino1978-Corp
Teino1978-Corp / ipup.sh
Created October 28, 2015 05:44 — forked from arpanpal010/ipup.sh
auto-login and IP chooser for my raspberry pi, run with a crontab entry
#!/bin/bash
loginPortal=""; #link to send the post req to
userName=""; #username for logging into the service
password=""; #password
dynDnsUpdateLink=""; #link to update the dynDNS service.
firstNumber01=""; #first number to precede the IP say 101.*.*.*
firstNumber02=""; #alternate
#get an ip beginning with $firstNumber01 or $firstNumber02 else reconnect
@Teino1978-Corp
Teino1978-Corp / all-in-one.html
Created October 28, 2015 05:48 — forked from arpanpal010/all-in-one.html
HTML/CSS/JS Minimal Template
<!doctype html>
<html>
<!--
TODO:
----
write things to do here
-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@Teino1978-Corp
Teino1978-Corp / tbkp.sh
Created October 28, 2015 05:51 — forked from arpanpal010/tbkp.sh
Tar based backup script. Provides options to select snapshot (when backing up) or restore points (when restoring)
#!/bin/bash
# backup script for incremental backups
tbkp () {
[[ -z "$1" ]] && ( echo "Usage:";
echo "tbkp /path/to/dir/"; return 1; )
fp="$(readlink -f "$1")"; #full path of dir to be used
if [ -d "$fp" ]; then
lc="${fp%/*}"; #absolute location to be removed from tar
@Teino1978-Corp
Teino1978-Corp / multisearch.js
Created October 28, 2015 05:54 — forked from arpanpal010/multisearch.js
multisearch - search multiple website from a single searchbox using ;prefixes (used in my homepage)
<script type="text/javascript">
function fn_search() {
var leader= ';'; //this key determines its a search prefix
var searchForm=document.getElementById('searchForm');
var actionList=[ // match string prefix names, field names and default input required by search engines
//{ //template
// match_string: "",
// name: "",
// url: "",
// extra_inputs: [
@Teino1978-Corp
Teino1978-Corp / mkpng.py
Created October 28, 2015 05:57 — forked from arpanpal010/mkpng.py
Crop and Convert any image into a wallpaper that fits the screen by default.
#!/bin/python2.7
import os, sys, re
from PIL import Image, ImageChops, ImageOps
def show_usage () :
print("""Simple JPEG to monitor sized wallpaper generator\nDeps: PIL(2.7)\nUsage:\n[python2.7] %s /path/to/image [/path/to/outfile] [WIDTHxHEIGHT]\n""" % (sys.argv[0],))
def makeThumb(f_in, f_out, size=(80,80), pad=False):
image = Image.open(f_in)
@Teino1978-Corp
Teino1978-Corp / gfeed2js.js
Created October 28, 2015 06:04 — forked from arpanpal010/gfeed2js.js
google feeds api parser in javascript. somewhat like feed2js but much simpler layout.
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
/*!-- Sample feedbox html --
<div class="feeds">
<p class="feed-title">
<a href="url">title</a>
description
</p>
<ul>
<li> entry </li>
@Teino1978-Corp
Teino1978-Corp / gitlister.sh
Created October 28, 2015 06:07 — forked from arpanpal010/gitlister.sh
Script to find git repositories when it becomes bit hard to keep track of cloned/modifed repos.
#!/bin/bash
#script to find git repositories when it becomes hard to keep track of all git repositories
#takes $1 as root path to search, default= $PWD
# argumnet -diff checks if any of the gits are modified locally
# argumnet -url checks if any of the gits are modified locally
# both arguments are enabled by default so use -nodiff, -nourl
#read location or use current dir
@Teino1978-Corp
Teino1978-Corp / passgen.sh
Created October 28, 2015 06:13 — forked from arpanpal010/passgen.sh
Simple password generator based on sha1 hashing and base64 encoding (require bash 4)
#!/bin/bash
#simple password geenrator based on sha1 hashing and base64 encoding.
#needs grep,read and sha1sum, base64
#written in bash 4.3.18
#
#added case-insensitivity in "INDEX"
#added master password hash generation
#added timing - clear screen after a time
#added hash based pasword checking (prompting for master password)
@Teino1978-Corp
Teino1978-Corp / rpibackup.sh
Created October 28, 2015 06:16 — forked from arpanpal010/rpibackup.sh
Backup files from remote pc to a single location in storage (preserves relative paths).
#!/bin/bash
#this script backs up files from various locations in a remote computer.
#using scp to SFTP the files from remote.
#files are stored as they are to / in $backupdir (hierarchy preserved), either specify absolute path for backupdir, or use $rootdir as a container
#in future this script will be run as a cronjob
#have to provide password everytime, TODO setup keys (although this has nothing to do with the script)
#usage: files that are to be backed up from pi (mainly configs and server settings)