Skip to content

Instantly share code, notes, and snippets.

View hardiksondagar's full-sized avatar

Hardik Sondagar hardiksondagar

View GitHub Profile
@hardiksondagar
hardiksondagar / youtube_embeds_custom.js
Created March 1, 2023 09:40
Hide Related Videos In YouTube Embeds
<!-- https://maxl.us/hide-related -->
<!-- author: https://www.maxlaumeister.com/articles/hide-related-videos-in-youtube-embeds -->
<style>
.hytPlayerWrap {
display: inline-block;
position: relative;
}
.hytPlayerWrap.ended::after {
content:"";
position: absolute;
@hardiksondagar
hardiksondagar / script.js
Last active September 6, 2021 14:38
Mute ads on sonyliv.com
/**
*
* Tired/irritated of hearing ads on sonyliv.com while watching cricket match?
* Follow below steps to mute when ads are running.
* 1. Start live cricket match
* 2. Open console ( press F12 in chrome ) and paste all the code below.
*
* @author : Hardik Sondagar
*
*/
@hardiksondagar
hardiksondagar / unlike-fb-pages.js
Last active April 12, 2022 09:34
Unlike or unfollow pages in Facebook
/**
* Unlike/unfollow pages in facebook.
* Open https://www.facebook.com/pages/?category=liked and scroll down till all liked/followed pages loads.
* Once all pages loads, copy paste this code in console and wait till all pages unliked/unfollowed (Use Google Chrome).
*/
var pages_followed = document.querySelectorAll('[aria-label="Following"]');
var pages_liked = document.querySelectorAll('[aria-label="Liked"]');
function sleep(ms) {
@hardiksondagar
hardiksondagar / main.py
Created October 14, 2020 09:32
Get Redirected URL
import requests
def get_redirect_url(url):
try:
headers = {
"User-Agent": " ".join([
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6)",
"AppleWebKit/537.36 (KHTML, like Gecko)",
"Chrome/86.0.4240.75",
"Safari/537.36"
])
@hardiksondagar
hardiksondagar / README.md
Created June 6, 2020 10:15
Create systemd service for Go binary

Create file at /lib/systemd/system/mygoservice.service

[Unit]
Description=mygoservice
ConditionPathExists=$GOPATH/src/mygoservice/mygoservice
After=network.target
 
[Service]
Type=simple
User=mygoservice
@hardiksondagar
hardiksondagar / loop-dates.sh
Created March 22, 2019 05:57
Looping through dates in shell script
#!/bin/bash -l
# loop-dates.sh 2019-02-01 2019-03-01
start_time=`date +"%Y-%m-%d" -d $1`
end_time=`date +"%Y-%m-%d" -d $2`
dt=$start_time
while [ "$dt" != "$end_time" ] ;
do
start=`date '+%Y-%m-%d %T' -d "$dt"`;
end=`date '+%Y-%m-%d %T' -d "$dt +1 day"`;
@hardiksondagar
hardiksondagar / dict_merge.py
Created February 26, 2019 11:48 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
# Recursive dictionary merge
# Copyright (C) 2016 Paul Durivage <pauldurivage+github@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@hardiksondagar
hardiksondagar / logging.yaml
Created February 26, 2019 11:48
Python - Logging configuration
---
version: 1
disable_existing_loggers: False
formatters:
simple:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
handlers:
console:
class: logging.StreamHandler
@hardiksondagar
hardiksondagar / instagram-auto-follow.js
Last active January 31, 2019 09:05
Auto follow users on Instagram
/**
*
* Auto follow users on Instagram Web
*
* Tired of following users one by one. Follow below steps to automate it.
* 1. Go to some user's profile i.e. https://www.instagram.com/spacex and click on followers, popup with user list will appear.
* 2. Open console ( press F12 in chrome ) and paste all the code below.
* 3. Wait while all the users are being followed.
*
* @author : Hardik Sondagar <hardikmsondagar@gmail.com>
@hardiksondagar
hardiksondagar / to-logger.sh
Created December 10, 2018 06:51
Shell script write output to syslog
#!/bin/bash
readonly SCRIPT_NAME=$(basename $0)
echo "Write to syslog" | logger -p user.notice -t $SCRIPT_NAME