Skip to content

Instantly share code, notes, and snippets.

View snambi's full-sized avatar

Nambi Sankaran snambi

View GitHub Profile
@snambi
snambi / awk-better-than-cut.md
Last active June 26, 2023 21:03
How to extract different fields from a CSV file and print in a different format

awk is better than cut

How to extract different fields from a CSV file and print in a different format

Input file in CSV format

Sample input file

837998483934.ecr.us-west-2.amazonaws.com,consoleapi,1.0.0-fg47d32
@snambi
snambi / add-usb.md
Last active March 11, 2022 04:50
Add an external USB drive permanently to Ubuntu
  1. Attach the USB drive to computer.
  2. Note the ID of the device
    # use lsblk to list the devices
    lsblk
    NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    loop0         7:0    0     4K  1 loop /snap/bare/5
    loop1         7:1    0  97.7M  1 loop /snap/core/12726
    sda           8:0    0 931.5G  0 disk

└─sda1 8:1 0 931.5G 0 part /media/ncdrive

@snambi
snambi / .bashrc
Last active August 14, 2021 23:21
Bash Setup
set -o vi
#stty erase ^H
alias xb="xterm -fg lightgreen -bg black -sl 5000 -sb -T dark &"
alias xg="xterm -fg lightgreen -bg grey20 -sl 5000 -sb -T dark &"
alias xa="xterm -fg black -bg white -sl 5000 -sb -T white &"
alias xc='xterm -fg black -bg bisque -sl 5000 -sb -T white &'
alias function="typeset -f"
@snambi
snambi / screen.md
Last active September 8, 2020 18:09
How to use "screen" between two users

Using screen in Linux

This gist provides two methods to use screen in Linux. The first method is easy, but it is less secure as it uses sudo privileges. The second method is hard, but the correct way to share a screen between two users.

Install "screen"

sudo apt update
@snambi
snambi / kube.md
Last active July 22, 2020 01:02
Kubernates Commands - Cheat Sheet

minikube

basic commands

minikube version
minikube start

kubectl

@snambi
snambi / ubuntu_16.04_set_mouse_speed.md
Last active June 8, 2020 09:24
Ubuntu 16.04 Adjust mouse/track pad speed and configure tap-to-click

Ubuntu 16.04 xinput

Setup Mouse/Touchpad speed and configure tap-to-click on the touch pad

display all input devices

xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ USBest Technology SiS HID Touch Controller	id=11	[slave  pointer  (2)]
⎜   ↳ Elan Touchpad                           	id=14	[slave  pointer  (2)]
@snambi
snambi / pyproject.toml
Created June 5, 2020 21:31
pyproject: dependencies hosted in internal artifactory
[tool.poetry]
name = "nlp_fasttext"
version = "0.1.0"
description = ""
authors = ["Nambi Sankaran <snambi@gmail.com>"]
[tool.poetry.dependencies]
python = "3.7.0"
fasttext = "0.9.2"
flask_restx = "0.2.0"
@snambi
snambi / gist:e0c41aebdc6a21748db097eb4ad48c35
Created March 9, 2020 16:33 — forked from pcgeek86/gist:a1fd9d26f8ad46b51adf9513f67b95f2
Install & test Selenium with Firefox / Gecko driver on headless Ubuntu 18.04 LTS server
sudo apt update
sudo apt install firefox python3-pip xvfb x11-utils --yes
sudo -H pip3 install bpython selenium
export DISPLAY=:2
Xvfb $DISPLAY -ac &
export GECKO_DRIVER_VERSION='v0.24.0'
wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz
tar -xvzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz
@snambi
snambi / xinput-list-props.sh
Last active June 17, 2019 12:44
xinput --list-props <id>
xinput --list-props 13
Device 'Elan Touchpad':
Device Enabled (169): 1
Coordinate Transformation Matrix (171): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Tapping Enabled (306): 1
libinput Tapping Enabled Default (307): 0
libinput Tapping Drag Enabled (308): 1
libinput Tapping Drag Enabled Default (309): 1
libinput Tapping Drag Lock Enabled (310): 0
libinput Tapping Drag Lock Enabled Default (311): 0
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
defaults
log global