Skip to content

Instantly share code, notes, and snippets.

Manoj Nathwani Manoj-nathwani

Block or report user

Report or block Manoj-nathwani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Manoj-nathwani
Manoj-nathwani / remove_flickr.md
Last active Jul 31, 2019
Update Jekyll blog to self hostings images
View remove_flickr.md

Problem

  • My Jekyll blog uses hundrads of images on flickr for free image hosting
  • buuuuuuuut it's 2019 now and flickr is no longer free 🙈

Solution

  • Download all images hosted on flickr and save them to /images/articles/
  • Replace all image src attributes to using the new image location
@Manoj-nathwani
Manoj-nathwani / script.py
Created Jan 30, 2019
id,city,country ---> id,lat,lon
View script.py
# -*- coding: utf-8 -*-
import csv, os, time
from geopy.geocoders import Nominatim
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'data.csv')
geolocator = Nominatim()
@Manoj-nathwani
Manoj-nathwani / script.py
Created Jan 30, 2019
id,lat,lon ---> id,city,country
View script.py
# -*- coding: utf-8 -*-
import csv, os, time
from geopy.geocoders import Nominatim
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
my_file = os.path.join(THIS_FOLDER, 'data.csv')
geolocator = Nominatim()
@Manoj-nathwani
Manoj-nathwani / raspberry_pi_config.md
Last active May 29, 2017
Setting up a Raspberry Pi
View raspberry_pi_config.md
View chartjs
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.js"></script>
<div class="panel panel-default">
<div class="panel-heading">Price Changes</div>
<div class="panel-body">
<canvas id="myChart"></canvas>
</div>
</div>
<script>
View a.py
import time, datetime, json
import RPi.GPIO as GPIO
import picamera, dht11
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.cleanup()
instance = dht11.DHT11(pin=14)
result = instance.read()
View gist:a97634e1999715a97bdea62e5f433a86
import RPi.GPIO as GPIO
import time
def bin2dec(string_num):
return str(int(string_num, 2))
data = []
GPIO.setmode(GPIO.BCM)
View gist:2425eff040f61c0a1ba5
// taken from https://www.hackster.io/Momy93/gps-datalogger-with-linkit-one-fe6541
#include <LGPS.h>
gpsSentenceInfoStruct info;
double latitude = 0.00;
double longitude = 0.00;
int sat_num = 0; //number of visible satellites
String lat_format = "0.00000", lon_format = "0.00000";
@Manoj-nathwani
Manoj-nathwani / Natas15.py
Created Mar 17, 2016
Natas15 using Python 3
View Natas15.py
# coding=utf-8
import requests, base64, ipdb
from bs4 import BeautifulSoup
username = 'natas15:'.encode()
password = 'AwWj0w5cvxrZiONgZ9J5stNVkmxdk39J'.encode()
url = 'http://natas15.natas.labs.overthewire.org'
chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
existsStr = 'This user exists.'.encode()
parsedChars = ''
View gist:0740abbc0a9061e803b9
<!DOCTYPE html>
<html>
<head>
<title>Simple click event</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style>
html,
body,
You can’t perform that action at this time.