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
# Folder hooks | |
folder-hook 'mailbox.gmail.com' 'source ~/.mutt/muttrc/mailbox.gmail.com.muttrc' | |
# Default account | |
source ~/.mutt/muttrc/mailbox.gmail.com.muttrc | |
# set tmpdir="~/Temp/tmp" | |
# Macros for switching accounts | |
macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/muttrc/mailbox.gmail.com.muttrc<enter><change-folder>!<enter>' |
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
import os | |
import re | |
import subprocess | |
from bs4 import BeautifulSoup | |
import rules | |
def replacer(url, html): | |
new = html | |
reload(rules) |
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
set -g @resurrect-processes ':all:' | |
#set -g mode-mouse on | |
set -g mouse on | |
# sane scrolling: | |
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'" | |
# In order for Tmux to do its magic focus-events option has to be set to on. | |
# Needed by 'tmux-focus-events.vim' |
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
# To get the reference for thevaram urai from tamilvu website for the offline-pages | |
$ for ff in $(find -maxdepth 1 -type f -name *son*); do sed -i -E "s/'l([0-9]+)uri.jsp/'http:\/\/www.tamilvu.org\/slet\/l\1\/l\1uri.jsp/g" $ff; done |
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
# Docker, Chrome and Ubuntu | |
# When the chrome container exists and it is running, to open a url in it from other applications | |
if [ "$CHROME_RUNNING" == "false" ]; then | |
docker start chrome | |
else | |
docker exec chrome sh -c "/usr/bin/google-chrome '$@' --user-data-dir=/data" &> /dev/null | |
fi | |
# Source: https://tuttlem.github.io/2015/10/08/docker-chrome-and-ubuntu.html |
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
# List all temples that have only one pathigam order by thirumurai | |
sqlite> select koil_name_ta, cast(thirumurai_1 as integer) as t1,cast(thirumurai_2 as integer) as t2, cast(thirumurai_3 as integer) as t3,cast(thirumurai_4 as integer) as t4,cast(thirumurai_5 as integer) as t5,cast(thirumurai_6 as integer) as t6,cast(thirumurai_7 as integer) as t7 from koil_pathigam WHERE ((thirumurai_1 is not null and COALESCE (thirumurai_2,thirumurai_3,thirumurai_4,thirumurai_5,thirumurai_6,thirumurai_7) is null) or (thirumurai_2 is not null and COALESCE(thirumurai_1,thirumurai_3,thirumurai_4,thirumurai_5,thirumurai_6,thirumurai_7) is null) or (thirumurai_3 is not null and COALESCE(thirumurai_1,thirumurai_2,thirumurai_4,thirumurai_5,thirumurai_6,thirumurai_7) is null) or (thirumurai_4 is not null and COALESCE(thirumurai_1,thirumurai_2,thirumurai_3,thirumurai_5,thirumurai_6,thirumurai_7) is null) or (thirumurai_5 is not null and COALESCE(thirumurai_1,thirumurai_2,thirumurai_3,thirumurai_4,thirumurai_6,thirumurai_7) is nu |
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
# List month names in Title case, Lower case and Upper case | |
$ for i in {1..12}; do month=$(date -d "$i/01" +%b); echo "${month} ${month,,} ${month^^}"; done | |
# Output | |
# Jan jan JAN | |
# Feb feb FEB | |
# Mar mar MAR | |
# Apr apr APR | |
# May may MAY | |
# Jun jun JUN |
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
# Select id and title from JSON File based on TEXT_TO_SEARCH and append it to OUTPUT.html | |
$ for f in $(find $PWD -name "JSON_FILE.json"); do idTitleTextArray=($(cat $f | jq -r -c '.categories[].articles[] | select(.title | contains("TEXT_TO_SEARCH"))|"\(.id).html\">\(.title)</a>"'|sort)); if [ ${#idTitleTextArray[@]} -gt 0 ];then echo "<a href=\"${f%/*}/web/html/${idTitleTextArray[@]}" >> OUTPUT.html; fi; done; | |
# Create MOBI ebook from HTML | |
$ ebook-convert OUTPUT.html OUTPUT.mobi |
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
# To set English and Tamil keyboard layout in lxde, add the below line to ~/.bashrc | |
setxkbmap -option grp:switch,grp:lwin_toggle,grp_led:scroll -layout "us,in" -variant "basic, tam_keyboard_with_numerals" |
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
If you want to replace path in images for WooProduct kept in sqlite | |
=================================================================== | |
The replace ((())) does extract filename from the existing path in the images | |
columsn and we add base path of the server folder for accesss | |
SQLITE Query command is as below | |
-------------------------------- | |
UPDATE local_wc_product SET Images = 'http://wordpress.com/wp-content/uploads/2018/04/' || replace(images, rtrim(images, replace(images, '/', '')),'') WHERE Images IS NOT NULL; |