Skip to content

Instantly share code, notes, and snippets.

View sicksand's full-sized avatar
💭
brewing coffee at Dapo Mokcik Kopi Pokcik

Shafiq Mustapa sicksand

💭
brewing coffee at Dapo Mokcik Kopi Pokcik
View GitHub Profile
@sicksand
sicksand / coronamy.js
Created November 24, 2020 06:52
a scriptable ios widget display current covid-19 case in malaysia
// Corona Widget by Shafiq Mustapa
// by @shafiqmustapa
// like what I do? buy me a coffee -> https://www.buymeacoffee.com/9itd16a
// HOW TO
// 1) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 2) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
const url = https://coronavirus-19-api.herokuapp.com/countries/Malaysia
const req = new Request(url)
@sicksand
sicksand / hellogold.js
Last active November 27, 2020 06:25
a scriptable ios widget to display hello gold spot price as well as buy and sell price
// Hello Gold Widget by Shafiq Mustapa
// by @shafiqmustapa
// like what I do? buy me a coffee -> https://www.buymeacoffee.com/9itd16a
// HOW TO
// 1) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 2) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
const endpoint = "https://api.hellogold.com/prod/api/v2/spot_price.json"
const req = new Request(endpoint)
@sicksand
sicksand / wp-rand.php
Created December 17, 2018 02:37
wp-rand.php
p<?php query_posts('orderby=rand&showposts=1&cat=75,76,77')
175.145.244.48:8080
175.139.218.9:8080
175.139.205.52:8080
43.228.245.164:80
175.144.71.3:53281
61.6.157.3:53281
113.23.179.114:8181
175.138.57.110:8080
@sicksand
sicksand / bouncerate.js
Created June 25, 2018 07:00
9hitsviewer bounce rate
while(1)
{
await Delay(15000);
ClickByTag("a", "random");
}
@sicksand
sicksand / jbfoodclubdirect.js
Created June 25, 2018 04:23
9hitsviewer jbfoodclub direct
await Delay(5000);
while(await IsLoading()){
await Delay(5000);
}
var ran = Random(0,100);
if(ran < 50) {
await Delay(15000);
ClickById("custom_html-3");
} else if(ran >=51 && ran < 70) {
await Delay(15000);
@sicksand
sicksand / gunainifromgoogle.js
Created June 25, 2018 04:22
9hitsviewer macro - Guna Ini from google
await Delay(1000);
while(await IsLoading()) {
await Delay(1000);
}
await Delay(5000);
ClickByXpath("input","type","text");
await Delay(3000);
Typing("gunaini");
await Delay(2000);
SendKeyPress(13);
@sicksand
sicksand / jbfoodclubfromgoogle.js
Created June 25, 2018 04:21
9hitsviewer macro - JBFoodClub from Google
await Delay(1000);
while(await IsLoading()) {
await Delay(1000);
}
await Delay(5000);
ClickByXpath("input","type","text");
await Delay(3000);
Typing("jbfoodclub");
await Delay(2000);
SendKeyPress(13);
@sicksand
sicksand / crontab.sh
Created January 4, 2018 04:27
Cron job backup mysql database everyday and delete file after 7 days
#backup retention only 7 days
0 1 * * * find /home/sicksand/backup -mtime +7 -type f -delete
#backup
0 5 * * * mysqldump -u empdb -empdbpassword --single-transaction empdb | gzip -9 > /home/sicksand/backup/empdb_`date +\%Y\%m\%d_\%H\%M\%S`.sql.gz
@sicksand
sicksand / checkslave.sh
Last active January 4, 2018 04:12
Check MySQL Replication Slave is running. If not will email to sysadmin using mailgun
#!/bin/bash
COUNT=`'SHOW SLAVE STATUS\G' | mysql -u root --password=password123 mysql | grep 'Master_Log_Pos' | awk '/Read/{a=$NF} /Exec/{b=$NF} END{print a-b}'`
# echo "count" $COUNT
# check if COUNT value is zero or not zero
if [ $COUNT -gt 0 ]; then
curl -s --user 'api:key-getyourkeyatmailgun' \
https://api.mailgun.net/v3/mg.shafiqmustapa.my/messages \
-F from='MySQL Replication Status <[email protected]>' \
-F to='Shafiq Mustapa <[email protected]>' \
-F cc='Project Manager <[email protected]>, Support <[email protected]>, ' \