Skip to content

Instantly share code, notes, and snippets.

View hardiksondagar's full-sized avatar

Hardik Sondagar hardiksondagar

View GitHub Profile
@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 <[email protected]>
@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
@hardiksondagar
hardiksondagar / bbb_boot_service_instructions.md
Created June 20, 2018 12:12 — forked from tstellanova/bbb_boot_service_instructions.md
How to setup a service to automatically run a python script when the BeagleBone Black (BBB) reboots. These instructions allow you to setup a python script to automatically start when the BeagleBone (running Angstrom linux with systemd) restarts.

Creating a service to startup at BeagleBone Black boot time:

  • Create a shell script such as /usr/bin/myFancyBash.sh:

      #!/bin/bash
    
      # this could be any runnable code or shell script, really
      /usr/bin/myFancyPython.py 
    

Note that the first line is critical.

@hardiksondagar
hardiksondagar / monitor_service.py
Created June 20, 2018 12:12 — forked from piraz/monitor_service.py
Script that monitors a service running on systemd. If service is not running the script will try to start the service.
#!/bin/python
#
# Copyright 2016 Flavio Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@hardiksondagar
hardiksondagar / docker
Last active August 10, 2017 12:02
Installations.blah
wget -qO- https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
@hardiksondagar
hardiksondagar / tree.py
Created July 14, 2017 09:58
Generate tree from parent child list
raw_data = [
{
"locationid": "106",
"parentlocationid": None,
"name": "Main Meter - 11KV",
"sensorid": 1176,
"appliancetype": "Main HT",
"messageversion": "M26",
"active": True,
"path": [106],
@hardiksondagar
hardiksondagar / d3.directive.js
Created June 14, 2017 09:08
Angular D3 Heatmap
(function() {
'use strict';
angular.module().directive('d3Heatmap', ['d3Service', function(d3Service) {
return {
restrict: 'EA',
scope: {
data: "=data",
onSelect: '&'
},
@hardiksondagar
hardiksondagar / toepoch.py
Created May 30, 2017 11:46
Pandas change Datetime to epoch
df['<epoch_column>'] = df['<datetime_column>'].dt.tz_localize('<timezone_string>').astype(np.int64) // 1e9
@hardiksondagar
hardiksondagar / README.md
Last active March 18, 2025 01:58
Download TV shows and movies via shell script

Required

  • lynx

    sudo apt-get install lynx
    

Example