Skip to content

Instantly share code, notes, and snippets.

View NISH1001's full-sized avatar
💭
Staring into the abyss...

Nish NISH1001

💭
Staring into the abyss...
View GitHub Profile
@NISH1001
NISH1001 / drive-wget.sh
Last active November 29, 2019 04:46
Get drive files using wget
#wget --load-cookies /tmp/cookies.txt "https://drive.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://drive.google.com/uc?export=download&id=<FILEID>' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=<FILEID>" -O <FILENAME> && rm -rf /tmp/cookies.txt
#/usr/bin/env bash
echo "i am paradox"
FILEID="1hJKCb4eF1AJih_dhZOJSF5VR-ZtRNaap"
FILENAME="model.zip"
link="https://drive.google.com/uc?export=download&id=$FILEID"
@NISH1001
NISH1001 / chromium-app-luncher.md
Created October 6, 2018 02:47
Lunch chromium app directly withou opening the browser

First get the app id

  • Go to the pat h/home/paradox/.local/share/applications/
  • When you open each file, you will see the texts in following format:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=ScreenMeter Time Tracker
@NISH1001
NISH1001 / cuda-tf-keras.md
Created October 4, 2018 08:58
A note on how we can train different models in different gpu in parallel

Method 1

First of all, we have tf.device thing that tensorflow has to offer for us to choose which gpu we want. Like:

with tf.device('/gpu:0'):
    a = tf.constant(3.0)

This allocates for gpu 0.

Method 2

@NISH1001
NISH1001 / 00-keyboard.conf
Created September 21, 2018 04:29
keyboard layout config for linux
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us,np"
Option "XkbModel" "pc104"
Option "XkbVariant" ",dvorak"
Option "XkbOptions" "grp:lwin_toggle"
EndSection
# put this file in /etc/X11/xorg.conf.d/
@NISH1001
NISH1001 / yolo.py
Created September 20, 2018 11:02
python wrapper over YOLO
from ctypes import *
import math
import random
def sample(probs):
s = sum(probs)
probs = [a/s for a in probs]
r = random.uniform(0, 1)
for i in range(len(probs)):
r = r - probs[i]
@NISH1001
NISH1001 / yolo.sh
Created September 20, 2018 05:58
yolo command
./darknet classify ../../tiny-yolo/tiny.cfg ../../tiny-yolo/tiny.weights data/dog.jpg
./darknet detect ../../tiny-yolo/tiny.cfg ../../tiny-yolo/tiny.weights data/dog.jpg
@NISH1001
NISH1001 / matplotlib.md
Last active November 14, 2018 08:04
matplotlib configuration tutorial

Change backend from Code

import matplotlib

# first check which backend
maplotlib.get_backend()

# change
matplotlib.rcParams['backend'] = 'GTK3Agg'
@NISH1001
NISH1001 / i-am-a-strange-loop
Created September 16, 2018 15:53
i-am-a-strange-loop
This file has been truncated, but you can view the full file.
Table of Contents
Praise
Title Page
Dedication
A note from the Publisher
WORDS OF THANKS
PREFACE
PROLOGUE
CHAPTER 1 - On Souls and Their Sizes
Soul-Shards
[
{
"name" : "paradox",
"age" : 0,
"location" : "nowhere"
},
{
"name" : "nishan",
"age" : 0,
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 5 columns, instead of 2 in line 1.
A very, very, very slow-moving, aimless movie about a distressed, drifting young man. 0
Not sure who was more lost - the flat characters or the audience, nearly half of whom walked out. 0
Attempting artiness with black & white and clever camera angles, the movie disappointed - became even more ridiculous - as the acting was poor and the plot and lines almost non-existent. 0
Very little music or anything to speak of. 0
The best scene in the movie was when Gerardo is trying to find a song that keeps running through his head. 1
The rest of the movie lacks art, charm, meaning... If it's about emptiness, it works I guess because it's empty. 0
Wasted two hours. 0
Saw the movie today and thought it was a good effort, good messages for kids. 1
A bit predictable. 0
Loved the casting of Jimmy Buffet as the science teacher. 1