Skip to content

Instantly share code, notes, and snippets.

View arpanpal010's full-sized avatar
🏠
Working from home

Arpan Pal arpanpal010

🏠
Working from home
View GitHub Profile
@arpanpal010
arpanpal010 / tempmon.sh
Created November 6, 2014 15:13
Simple CPU temperature monitor, also displays core speeds if available. Requires manual setting of temperature sources
#tempmon modified
function tempmon() {
# datadir="$HOME/tempinfo";
datadir="/tmp/tempinfo";
# rm -rf $datadir;
mkdir -p $datadir;
sleeptime=10; #seconds
@arpanpal010
arpanpal010 / .gitconfig
Last active August 29, 2015 14:12 — forked from pksunkara/config
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@arpanpal010
arpanpal010 / tbkp.sh
Created January 8, 2015 14:46
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
@arpanpal010
arpanpal010 / all-in-one.html
Created January 20, 2015 16:00
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">
@arpanpal010
arpanpal010 / chatbox.py
Created February 4, 2015 14:15
minimal text based bulletin board using http.server, single threaded, auto refreshes. exactly 100 loc.
from __future__ import print_function #from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import http.server, urllib, datetime
#=================================================================
sUrl="/chatbox" #server url
port=8080 #server port
timedRefresh="15" #time before page refreshes
msgBox=[] #messages held here as dict objects
#=================================================================
# create html
#=================================================================
@arpanpal010
arpanpal010 / ipup.sh
Created May 7, 2015 03:30
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
@arpanpal010
arpanpal010 / mkpng.py
Created August 1, 2015 05:41
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)
@arpanpal010
arpanpal010 / new-session.sh
Created August 27, 2015 07:42
TMUX session creator / manager
#!/bin/bash
sessionPWD="/home/$USER/";
sessionName="new-session"; #must be same as filename
#check if already created
cd ${sessionPWD};
#create SESSION
tmux new-session -s ${sessionName} -n vim -d
#first window 1: vim
tmux send-keys -t ${sessionName} 'vim' C-m
@arpanpal010
arpanpal010 / mockServer.py
Created September 29, 2015 07:11 — forked from mandalpuspendu/mockServer.py
api test
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
@arpanpal010
arpanpal010 / awsetbg.sh
Last active December 5, 2023 16:02
wallpaper cropper and setter for awesomeWM, also generates theme and shell colors
#!/bin/bash
# default location of theme and wallpaper
# replace 'awtheme' with your current theme
wallpaperDestination="$HOME/.config/awesome/themes/awtheme/wallpaper";
# add #include "/home/arch/.Xresources_colors" to .Xresources
colorScriptDestination="/home/arch/.Xresources_colors"
# add [[ -f "$HOME/.bash_colors" ]] && . "$HOME/.bash_colors"; to .bashrc
# bashColorsDestination="/home/arch/.bash_colors"