Skip to content

Instantly share code, notes, and snippets.

@vishless
vishless / increase_file_watchers
Last active May 5, 2020 09:33
Increase file watchers in Ubuntu from 8192 to 16384
echo 16384 | sudo tee /proc/sys/fs/inotify/max_user_watches
### The following is the error msg when file watchers limit is reached.
Starting the development server...
events.js:287
throw er; // Unhandled 'error' event
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/tnl/Projects/Aspire/ihop-mapping/public'
@vishless
vishless / block_swap
Created April 3, 2020 04:59
Block swap algorithm for array rotation
1 2 3 4 5 6 7
n = 7 d = 2
3 4 5 6 7 1 2
A = 1 2 B = 3 4 5 6 7
Br = 6 7 Bl = 3 4 5
git config --global core.excludesfile ~/.gitignore
@vishless
vishless / react-cheatsheet
Created March 2, 2020 06:24
Command for getting up and running with react.
** To create a react app **
npx create-react-app <app-name>
** To Start the dev server **
npm start
** if there is a react app without `node_modules` folder
** one way to get it running is to install node modules,
** this works only if there is a package.json file in the directory
npm install
@vishless
vishless / gnome_window_button_position_config
Created January 14, 2020 07:01
Move window buttons to the right side of the title bar in gnome
# Read somewhere that it does not work on Unity and requires a gnome desktop (haven't checked)
gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close'
@vishless
vishless / .bashrc
Created December 31, 2019 06:39
bash configuration file
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@vishless
vishless / steam_artwork
Created July 31, 2019 16:31
Command while uploading steam artwork
document.getElementsByName("image_width")[0].value = 1000;document.getElementsByName("image_height")[0].value = 1;
@vishless
vishless / wa-synaptic-sudo
Created July 30, 2019 03:38
Workaround for the issue of running synaptic as sudo
If running Ubuntu 17.10 or newer, this issue can arise when an application has not been updated with full support for Wayland.
As a workaround until the application is updated, you can run
xhost +SI:localuser:root
@vishless
vishless / autoexec.cfg
Last active September 21, 2020 17:12
autoexec config file for CSGO
// Knife-Weapon Quick Switch
bind q "slot3; cl_righthand 0";
alias +knife1 "slot3; cl_righthand 0";
alias -knife1 "slot1; cl_righthand 1";
bind a +knife1
alias +knife2 "slot3; cl_righthand 0";
alias -knife2 "slot2; cl_righthand 1";
bind w +knife2
@vishless
vishless / ipfs_hash
Created June 14, 2019 06:51
Test file publish sharing of IPFS
QmZULkCELmmk5XNfCgTnCyFgAVxBRBXyDHGGMVoLFLiXEN