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
__BEGIN__ | |
*vimtips.txt* For Vim version 7.3. | |
------------------------------------------------------------------------------ | |
" new items marked [N] , corrected items marked [C] | |
" *best-searching* | |
/joe/e : cursor set to End of match | |
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C] | |
/joe/s-2 : cursor set to Start of match minus 2 | |
/joe/+3 : find joe move cursor 3 lines down | |
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line) |
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
require 'json' | |
require 'rest-client' | |
puts 'Creating User Stories from github issutes.. STARTED!' | |
#getting github's token: https://help.github.com/articles/creating-an-access-token-for-command-line-use | |
github_token = "token foo" | |
#github params | |
github = {:url => 'https://api.github.com/repos/foo/foo/issues', :token => github_token} |
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 bulk rename files with increment or decrement | |
================================================ | |
e.g. | |
song_002.mp3 | |
song_003.mp3 | |
... | |
song_011.mp3 | |
To rename above file list to: |
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 modify openldap ACL | |
######################## | |
# delete the existing ACL | |
# delete-acl.ldif | |
dn: olcDatabase={1}hdb,cn=config | |
changetype: modify | |
delete: olcAccess |
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; |
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
# 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
# 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
# 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
# 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 |