Skip to content

Instantly share code, notes, and snippets.

View yazdipour's full-sized avatar
:shipit:
Make Us Great Again

Shahriar yazdipour

:shipit:
Make Us Great Again
View GitHub Profile
# 05_h.png >> 05_half.png
for file in *.png; do mv "$file" "${file/_h.png/_half.png}"; echo $f;done
# * >> *.mp4
for file in *; do mv "$file" "$file.mp4";done
# */*/ -rec >> remove *.pdf && *.doc
IFS=$'\n'; set -f ## To skip problem of directories with spaces
for f in $(find . -name '*.pdf' -or -name '*.doc'); do rm "$f"; echo $f;done
unset IFS; set +f
@yazdipour
yazdipour / UTM.java
Last active September 15, 2023 12:40
UTM, WGS84 Converter
import java.util.Locale;
/**
* Class representing UTM-coordinates. Based on code from stack overflow.
* @see <a href="https://stackoverflow.com/questions/176137/java-convert-lat-lon-to-utm">Stack Overflow</a>
* @see <a href="https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system">Wikipedia-entry on UTM</a>
* @author Rolf Rander
*/
public class UTM
{
@yazdipour
yazdipour / gist:d7e2e64696a19d8bddd272bb9f611933
Created April 30, 2018 08:05 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@yazdipour
yazdipour / README.md
Created April 5, 2018 15:33 — forked from MoOx/README.md
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
title tags authors
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
git
github
gitlab
bitbucket
MoOx
# using:
# for set proxy:
# $ setproxy 127.0.0.1 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,127.0.0.1,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"
@yazdipour
yazdipour / breachcompilation.txt
Created December 21, 2017 21:47
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@yazdipour
yazdipour / labels_1024.tsv
Created October 11, 2017 12:16 — forked from teamdandelion/labels_1024.tsv
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
@yazdipour
yazdipour / text2speech.py
Created October 5, 2017 21:02
Preparing for IELTS Listening Numbers
import win32com.client as wincl
import random
from time import sleep
speak = wincl.Dispatch("SAPI.SpVoice")
problems=[13,30,4,14,40,5,15,50,6,16,60,70,17,'seventh','sixth','fifth','fourth']
while True:
rnd=str(random.choice(problems))
speak.Speak(rnd)
@yazdipour
yazdipour / open.py
Last active September 12, 2017 02:40
Use this to open list of word in dictonary
import webbrowser
mom="http://dictionary.cambridge.org/dictionary/english/"
fs="line.txt"
f=open(fs, 'r+')
lines = tuple(f)
f.close()
for l in lines:
l=l.replace('\n','').lower()
if len(l)>1:
webbrowser.open(mom+l)
# import Image
# f = raw_input('Image:\n')
# im = Image.open(f)
# rgb_im = im.convert('RGB')
# r, g, b = rgb_im.getpixel((x, y))
# def distance(c1, c2):
# (r1,g1,b1) = c1
# (r2,g2,b2) = c2