Skip to content

Instantly share code, notes, and snippets.

@azizultex
Last active March 14, 2019 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azizultex/56c12a17c2374bdafe5bcccf398d1404 to your computer and use it in GitHub Desktop.
Save azizultex/56c12a17c2374bdafe5bcccf398d1404 to your computer and use it in GitHub Desktop.
Repo that stores al the commands I used while using Linux system
// CREATE, ADD, PERMIT, AND CHECK A USER TO A GROUP
1. adduser username // 'username' is your expected username and follow the prompts to set the new user's information.
2. sudo usermod -aG docker ${USER} // 'docker' is group name. If you need to add a user to the docker group that you're not logged in as, declare that username "${USER}" explicitly using.
3. su - ${USER} // Use the su command to switch to the new user account.
4. id -nG // Confirm that your user is now added to the docker group by typing. It will list all the groups of this user
// SEARCH INSTALLED PACKAGES USING KEYWORD
dpkg -l | grep -i docker
// UNINSTALL A PROGRAM COMPLETELY
sudo apt-get purge docker-ce
// REMOVE A DIRECTORY COMPLETELY
sudo rm -rf /var/lib/docker
// list all available commands
compgen -ac or search command compgen -ac | grep gbiz
// list all users
compgen -u or getent passwd
// list all groups
compgen -g or getent group or All groups with a specific user: getent group | grep username
// fix any packages issues while updating
sudo apt update --fix-missing
// check version
lsb_release -a
// check bit
uname -i
// list all available repositories
apt policy
// source list locations
/etc/apt/sources.list
// remove a PPA repo
sudo add-apt-repository --remove ppa:PPA_REPOSITORY_NAME/PPA
i.e. to remove videolan - sudo add-apt-repository --remove ppa:videolan/master-daily
// install zip files on ubuntu
https://www.quora.com/How-do-I-install-a-tar.bz2-file-in-Ubuntu
I had a problem install firefox developer edition and fixed it following - https://askubuntu.com/questions/548003/how-do-i-install-the-firefox-developer-edition
// fix Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock issue
1. https://www.zyxware.com/articles/5539/solved-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysqld-sock
// list hardware
sudo lshw -c vieo or sudo lshw -c display
// search all graphics drivershttps:
https://www.cyberciti.biz/faq/ubuntu-linux-install-nvidia-driver-latest-proprietary-driver/
apt search nvidia-driver
// install a driver
sudo apt install your_choiced_driver_name
// check nvidia driver setup
nvidia-smi
// Benchmarking Graphics
https://askubuntu.com/questions/1046812/how-can-i-tell-how-well-my-graphics-card-performs-on-ubuntu
https://www.cyberciti.biz/faq/linux-tell-which-graphics-vga-card-installed/
glxgears , glxheads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment