Skip to content

Instantly share code, notes, and snippets.

View oneamitj's full-sized avatar
💭
he-ya!!!

Amit Joshi oneamitj

💭
he-ya!!!
View GitHub Profile
@oneamitj
oneamitj / RoR_Installer.sh
Last active August 29, 2015 14:18
Ruby on Rails installer for linux.
#!/bin/bash
# Some Color coding
red='\e[31m'
grn='\e[32m'
yel='\e[33m'
blu='\e[34m'
pnk='\e[35;40m'
org='\e[33;40m'
wht='\e[0m'
@oneamitj
oneamitj / hellocomics.py
Last active March 29, 2016 07:59
download all chapters of the given comics, url of hellocomic.com
#!/usr/bin/python3
import urllib.request, urllib.error, urllib.parse
from pdb import set_trace
from bs4 import BeautifulSoup
import os
url = input('Enter url from hellocomic.com: ')
# url = 'http://www.hellocomic.com/miles-morales-ultimate-spider-man/c1/p1'
@oneamitj
oneamitj / install-apache.sh
Last active December 19, 2015 02:50 — forked from domderen/install.sh
Installation of apache spark on ubuntu machine.
#!/bin/sh
# installation of Oracle Java JDK.
sudo apt-get -y update
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java7-installer
# Installation of commonly used python scipy tools
@oneamitj
oneamitj / Sublime Text 3 Build 3103 License Key - CRACK
Last active October 18, 2017 06:05
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@oneamitj
oneamitj / download_songs.py
Last active August 29, 2016 08:36
Download songs from a ftp I found online...
#!/usr/bin/python3
import urllib.request, urllib.error, urllib.parse
from pdb import set_trace
from bs4 import BeautifulSoup
import os,sys
file_name = ""
def reporthook(blocknum, blocksize, totalsize):
@oneamitj
oneamitj / currency.sol
Last active February 26, 2020 16:42
Demo Smart Contract for currency simulation
pragma solidity 0.4.11;
contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
@oneamitj
oneamitj / SetupEth.md
Created April 12, 2018 04:54
Setting up multi node private blockchain network.

Setting up local Ethereum chain (Primary Host Node)

  1. Install ethereum client (geth).

    • Mac

        brew tap ethereum/ethereum
        brew install ethereum
      
    • Linux (Debian)

@oneamitj
oneamitj / crawl_fb.py
Last active April 20, 2018 11:47
Crawl facebook public page for posts with comments and save it to sqlite db, using python with facebook graph api.
import time
import datetime as dt
import sqlite3
import json
import urllib.request, urllib.error, urllib.parse
FB_PAGE_ACCESS_API = "YOUR FACEBOOK PAGE ACCESS API KEY HERE"
class Database:
@oneamitj
oneamitj / renameYTsongs.py
Created July 15, 2018 09:40
Correctly rename youtube downloaded official songs with Artist and Title.
import stagger
from stagger.id3 import *
import os
dir_name = "/path/to/dir/with/songs"
file_list = os.listdir(dir_name)
# Filename in format = "Ariana Grande - No Tears Left To Cry.mp3"
for filename in file_list:
full_filename = dir_name + "/" + filename
print(full_filename)
@oneamitj
oneamitj / EthAsDB.sol
Created March 26, 2019 13:20
An example of using ethereum to save data.
// Estimated Gas: 1,368,083
pragma solidity ^0.4.24;
library StringOperation {function concat(string string1, string string2, string sep) internal pure returns (string){
bytes memory string1Bytes = bytes(string1);
bytes memory string2Bytes = bytes(string2);
bytes memory sepBytes = bytes(sep);
string memory concatString = new string(string1Bytes.length + sepBytes.length + string2Bytes.length);