Skip to content

Instantly share code, notes, and snippets.

View pawiromitchel's full-sized avatar
🔥
By doing nothing, you become nothing

Mitchel pawiromitchel

🔥
By doing nothing, you become nothing
View GitHub Profile
@pawiromitchel
pawiromitchel / db.pdi
Created July 3, 2020 12:13
Pentaho MySQL database connection
# choose generic connection
jdbc:mysql://${HOST}:3306/${DATABASE}
com.mysql.cj.jdbc.Driver
${USERNAME}
${PASSWORD}
@pawiromitchel
pawiromitchel / automove.sh
Created June 24, 2020 22:39
Automove mouse in Linux
# infinite loop, press Ctrl + C to stop
while :
do
# get a random number between -200 and 200 for X and Y
x=$((-200 + RANDOM % 200))
y=$((-200 + RANDOM % 200))
sleep=$((1 + RANDOM % 5))
echo "sleep for" $sleep "seconds"
@pawiromitchel
pawiromitchel / find-string-in-files-linux.md
Last active December 10, 2020 12:01 — forked from jmuyden/find-string-in-files-linux.md
Find/Search string in files LINUX

Do the following:

grep -rnw '/path/to/somewhere/' -e 'pattern' -r or -R is recursive, -n is line number, and -w stands for match the whole word. -l (lower-case L) can be added to just give the file name of matching files. Along with these, --exclude, --include, --exclude-dir flags could be used for efficient searching:

This will only search through those files which have .c or .h extensions:

@pawiromitchel
pawiromitchel / disable_windows_update.bat
Last active July 21, 2020 02:56
Fuck you winblows ...
# source: https://www.reddit.com/r/windows/comments/7zb0gb/disabling_windows_10_autoupdates_for_good/
# run with Administrator
net stop wuauserv
net stop bits
net stop dosvc
# fuck you windows
net stop superfetch
@pawiromitchel
pawiromitchel / test.py
Created April 26, 2020 22:01
MT5 | Place a trade programmatically with python
import requests as req
import json
import time
import MetaTrader5 as mt5
order = json.loads('{ "status": "NEW", "type": "BUY", "ticker": "EURUSD", "take_profit": "1.0820987897891143", "stop_loss": "1.0819768153163283" }')
# display data on the MetaTrader 5 package
print("MetaTrader5 package author: ", mt5.__author__)
print("MetaTrader5 package version: ", mt5.__version__)
def readmail(volume):
time.sleep(1.5)
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user, pwd)
m.select('"[Gmail]/All Mail"')
resp, items = m.search(None,
"NOT SEEN FROM tradingview")
items = items[0].split()
for emailid in items:
resp, data = m.fetch(emailid,
@pawiromitchel
pawiromitchel / *.sql
Created March 3, 2020 14:14
Kill all MySQL Queries of a specific user
SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') FROM information_schema.processlist WHERE user = 'user'
@pawiromitchel
pawiromitchel / tutorial_kali_autologin_afterupdate.txt
Created November 2, 2019 12:23 — forked from intrd/tutorial_kali_autologin_afterupdate.txt
Kali light xfce4 root autologin (works after lightdm update)
## Kali light xfce4 root autologin (works after lightdm update)
# @author intrd - http://dann.com.br/
# @license Creative Commons Attribution-ShareAlike 4.0 International License - http://creativecommons.org/licenses/by-sa/4.0/
After lighdtdm update root autologin is broken fix doing this:
nano /etc/lightdm/lightdm.conf
at [Seat:*] group uncomment/edit:
autologin-user=root
autologin-user-timeout=0
git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
@pawiromitchel
pawiromitchel / bulk_rename.sh
Created August 29, 2019 11:41
Bulk rename files and increment the name
a=10000121
for i in *.idx; do
mv -i -- "$i" "$a"
let a=a+1
done