Skip to content

Instantly share code, notes, and snippets.

View lokeshsoni's full-sized avatar
🏠
Working from home

Lokesh Soni lokeshsoni

🏠
Working from home
View GitHub Profile
@lokeshsoni
lokeshsoni / repo-reset.md
Created August 19, 2020 11:47 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@lokeshsoni
lokeshsoni / setup.sh
Last active April 16, 2020 07:33
Android Studio Setup on Google Compute Engine
gcloud compute disks \
create disk1 \
--image-project ubuntu-os-cloud \
--image-family ubuntu-1804-lts \
--zone us-central1-b
gcloud compute images \
create nested-vm-image \
--source-disk disk1 \
# jupyterlab-code-formatter
conda install -c conda-forge black
jupyter labextension install @ryantam626/jupyterlab_code_formatter
conda install -c conda-forge jupyterlab_code_formatter
jupyter serverextension enable --py jupyterlab_code_formatter
@lokeshsoni
lokeshsoni / ubuntu_remote_desktop.sh
Last active December 8, 2023 15:20
Google Cloud Ubuntu Remote Desktop Setup
# Install Chrome Remote Desktop on the VM instance
wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
sudo apt update
sudo dpkg --install chrome-remote-desktop_current_amd64.deb
sudo apt install --assume-yes --fix-broken
# install desktop environment
sudo apt install ubuntu-desktop
# install google-chrome
#!/bin/bash
sudo yum update -y
sudo yum install -y git bzip2 vim htop tree zip unzip
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p ${HOME}/miniconda
rm miniconda.sh
@lokeshsoni
lokeshsoni / cifar10-darknet-gist0509.ipynb
Created August 13, 2018 08:32 — forked from daveluo/cifar10-darknet-gist0509.ipynb
Demo of CPU-only Predictions and Pytorch Model Saving/Loading, 5/9/2018
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lokeshsoni
lokeshsoni / tmux-cheatsheet.markdown
Created March 19, 2018 12:40 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
import warnings
warnings.filterwarnings("ignore")
import os
from shutil import copy
from flask import jsonify
from time import time
import numpy as np
from flask import Flask, request, render_template, send_from_directory
from keras.models import load_model
@lokeshsoni
lokeshsoni / Tranfer_Learning_Keras_02.py
Created January 15, 2018 05:31 — forked from prakashjayy/Tranfer_Learning_Keras_02.py
Transfer Learning using Keras
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D
from keras import backend as k
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping
img_width, img_height = 256, 256
"""Downsized version of Xception, without residual connections.
"""
from __future__ import print_function
from __future__ import absolute_import
from keras.models import Model
from keras.layers import Dense
from keras.layers import Input
from keras.layers import BatchNormalization
from keras.layers import Activation