Skip to content

Instantly share code, notes, and snippets.

View arpanpal010's full-sized avatar

Arpan Pal arpanpal010

View GitHub Profile
@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"
@arpanpal010
arpanpal010 / linkthedots.sh
Last active January 31, 2020 18:03
copy dot files from various locations to a single folder for backup.
#!/bin/bash
#script to copy the dotfiles to/from here to/from their proper places
#added file structure preservation - files are copied to their location related to root
#added logging errors
#to clone/sync my dotfiles: git clone https://github.com/arpanpal010/dotfiles.git
#Usage:
#$ sh linkthedots.sh collect --> get files
@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 / cache-service.ts
Created October 19, 2017 14:37
A generic caching mechanism that stores in localstorage.
export static class CacheService {
// static $inject = ["localStorageService", "$rootScope", "$timeout"]
private static ls : localStorageService = undefined; // wrap localstorage to hide data
private static instance : CacheService = undefined;
private callables : Object = {};
private asyncCallables : Object = {};
constructor(ls : any, rootScope : any, timeout : any) {
if(!this.instance) {
@arpanpal010
arpanpal010 / about-rpi.md
Last active August 1, 2017 11:13
Raspberry Pi configurations

##Configurations for Raspberry Pi Home Server## #####Using Raspbian##### (although the procedures are similar/compatible with most debian based systems.)

###Added###

  • [sysctl.conf mods] (#file-sysctl-md)
  • [Firewall config] (#file-firewall-md)
  • [DNS Server] (#file-dns-md)
  • [Dynamic Dns] (#file-dyndns-md)
  • [Git Server] (#file-git-server-md)
@arpanpal010
arpanpal010 / multisearch.js
Created November 6, 2014 15:05
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: [
@arpanpal010
arpanpal010 / cryptmount.sh
Created July 29, 2014 05:50
wrapper for cryptsetup with LUKS.
#!/bin/bash
#script wrapper to create/(u)mount/resize encrypted non-root filesystems using cryptsetup + LUKS
#does NOT unmount automatically on shutdown.
#Truecrypt is insecure.
#more info: https://wiki.archlinux.org/index.php/Dm-crypt
#TODO
#move functions to own module function
#improve cli
@arpanpal010
arpanpal010 / ytp.sh
Last active May 18, 2016 17:02
Youtube player for raspberry pi. Using pip version of Youtube-DL and omxplayer that comes default in Raspbian.
#!/bin/bash
# youtube url player for raspberry pi,
# ------------------------------------------------------------------
ytdlCmd="youtube-dl";
ytdlArgs="-f 140 --prefer-ffmpeg -g"; # 141 - 256k audio, 140 - 128k audio, 22 - best quality available
playerCmd="omxplayer";
playerArgs="--vol -300";
#!/bin/sh
# System Update
pacman --noconfirm -Syu
#The essentials
pacman --noconfirm -S base-devel vim git
# Packer (AUR Helper)
cd /tmp
@arpanpal010
arpanpal010 / ctags definitions for Javascript
Created December 8, 2015 16:36 — forked from tim-smart/ctags definitions for Javascript
CTags Definitions for Javascript
--langdef=js
--langmap=js:.js
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/
--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/