Skip to content

Instantly share code, notes, and snippets.

View Manoj-nathwani's full-sized avatar

Manoj Nathwani Manoj-nathwani

View GitHub Profile
<!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,
@Manoj-nathwani
Manoj-nathwani / Natas15.py
Created March 17, 2016 20:19
Natas15 using Python 3
# 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 = ''
// 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";
import RPi.GPIO as GPIO
import time
def bin2dec(string_num):
return str(int(string_num, 2))
data = []
GPIO.setmode(GPIO.BCM)
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()
<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>
@Manoj-nathwani
Manoj-nathwani / raspberry_pi_config.md
Last active May 29, 2017 22:22
Setting up a Raspberry Pi
@Manoj-nathwani
Manoj-nathwani / script.py
Created January 30, 2019 15:15
id,lat,lon ---> id,city,country
# -*- 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 January 30, 2019 15:57
id,city,country ---> id,lat,lon
# -*- 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 / remove_flickr.md
Last active July 31, 2019 02:27
Update Jekyll blog to self hostings images

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