Skip to content

Instantly share code, notes, and snippets.

@count48
Last active July 24, 2019 10:15
Show Gist options
  • Save count48/e37565f273714082b830a80619daf8df to your computer and use it in GitHub Desktop.
Save count48/e37565f273714082b830a80619daf8df to your computer and use it in GitHub Desktop.
These are tricky stuff . these are commands useful in figuring out things and fixing problems

Figuring out whats eating up internet speed on my machine

  sudo nethogs wlp5s0

To make an application running on port 49161 to be available at port 1521

This is useful when you dont want go down the rabit hole to find out how you want to change the default port of an application

   sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 1521 -j REDIRECT --to-port 49161

Clear RAM Memory Cache, Buffer and Swap Space

Clear PageCache only.

   sync; echo 1 > /proc/sys/vm/drop_caches

Clear dentries and inodes.

   sync; echo 2 > /proc/sys/vm/drop_caches

Clear PageCache, dentries and inodes.

   sync; echo 3 > /proc/sys/vm/drop_caches 

Get stats of Redis

redis-stat is a cool and simple Redis monitoring tool written in Ruby.

   https://github.com/junegunn/redis-stat # link 

Installation

   gem install redis-stat

start Server mode

   redis-stat --verbose --server=8080 5

Command line mode

  redis-stat localhost localhost:6380 1 10 --csv=/tmp/output.csv --verbose

#SSH setup

Create public and private keys using ssh-key-gen on local-host

    ssh-keygen

Password less ssh access to a remote server( after ssh is set-up keys locally

    ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host

Groups a user belong to

   groups user

alternative to installing redis-cli

     nc -v  localhost 49171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment