Skip to content

Instantly share code, notes, and snippets.

View akashjobanputra's full-sized avatar

Akash Jobanputra akashjobanputra

View GitHub Profile
@akashjobanputra
akashjobanputra / createSwapFile.sh
Last active August 29, 2017 06:02
Create & use swap file to temporarily increase swap size
#!/bin/bash
sudo dd if=/dev/zero of=/swap bs=10M count=100 #Creates a file of size 1000M
sudo losetup /dev/loop0 /swap
sudo mkswap /dev/loop0
sudo swapon /dev/loop0
@akashjobanputra
akashjobanputra / README-Python-3.5.1.md
Created October 3, 2017 05:44
Build Python 3.5.1 from source

Python 3.5.1 from source

Extra modules required to build python from source

sudo apt install $(cat apt_requirements.txt)

@akashjobanputra
akashjobanputra / README-install-cv2-raspberryPi3.md
Last active October 4, 2017 09:29
Opencv 3.1.0 in Raspberry Pi3 .deb and requirements from apt

Installing OpenCV 3.1 on Raspbian Jessie (RPi3 - easy way)

Installation

  • Run the following commands
    -$ sudo apt install $(cat cv2_requirements_apt.txt)
    -$ sudo ldconfig
    -$ sudo dpkg -i opencv_3.1.0_armhf.deb
@akashjobanputra
akashjobanputra / stayAlive.py
Created May 24, 2018 14:28
Sophos Network Access Login script to avoid logging in from Browser every hour
import requests
import time
localtime = int(time.time())
r = requests.post('http://COPERNICUS_HOST:PORT/login.xml', data={
'username': 'PLAINTEXT_USERNAME',
'password': 'PLAINTEXT_PASSWORD',
'mode': 191,
'producttype': 0,
@akashjobanputra
akashjobanputra / piVideoRecorder.py
Created June 6, 2018 14:35
Create 2 minute video clips from PiCam Raspberry Pi 3
import subprocess
import time
import os
import sys
if len(sys.argv) > 1:
directory = sys.argv[1]
else:
directory = './videos'
directory = os.path.abspath(directory)
import re
LINEBREAK_REGEX = re.compile(r'((\r\n)|[\n\v])+')
NONBREAKING_SPACE_REGEX = re.compile(r'(?!\n)\s+')
def normalize_whitespace(text):
"""
Given ``text`` str, replace one or more spacings with a single space, and one
or more linebreaks with a single newline. Also strip leading/trailing whitespace.
@akashjobanputra
akashjobanputra / README.md
Last active June 22, 2018 09:40
Noisli black background

Noisli Black Background

Install this extensions on chrome: Custom JS And open noisli.com and enter the code from this js to the Custom JS editor.

Keybase proof

I hereby claim:

  • I am akashjobanputra on github.
  • I am akashj (https://keybase.io/akashj) on keybase.
  • I have a public key ASCyYXn50JrN1sf4dLdvsw_l_Ra-btbHSaReyDK3kLgQxAo

To claim this, I am signing this object:

@akashjobanputra
akashjobanputra / tesseract-3.04.sh
Last active July 3, 2018 15:56 — forked from IaroslavR/gist:834066ba4c0e25a27078
Install Tesseract 3.04 on Amazon AWS AMI
sudo yum install autoconf aclocal automake
sudo yum install libtool
sudo yum install libjpeg-devel libpng-devel libtiff-devel zlib-devel
cd ~/downloads
wget http://www.leptonica.com/source/leptonica-1.72.tar.gz
tar -zxvf leptonica-1.72.tar.gz
cd leptonica-1.72
./configure
make
sudo make install
@akashjobanputra
akashjobanputra / Screenshot.png
Last active September 2, 2018 17:35
my bash prompt with git branch
Screenshot.png