search

Latest posts


This site will be aimed primarily at programming, gaming, computers and will include a few other things.

apt-get install python-apt


mysql -u root -p 

mysql> CREATE DATABASE <name>;

mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'

mysql> GRANT ALL PRIVILAGES ON dbname.* TO 'user'@'localhost'

https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

i - insert mode

esc - command mode

:wq - write to file and quit

:w [file name] - if you didn't enter a file name to begin with

:ZZ to save and quit

:q! to quit without saving

How to add swap to Ubuntu

This only the commands. Full reference can be found here.

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
sudo nano /etc/fstab
/swapfile none swap sw 0 0

Basic Commands
ls   
ls -a
ls -l
cd
cd folder/
pwd
mkdir - make directory
mkdir -p folder/folder/ - create multi level folders
List distro info
cat /etc/*-release
lsb_release -a
cat /proc/version
Adding users and group
adduser user addgroup group adduser user group (re-login for it to take effect)
Remove password from a user
passwd -d <user>
Add to a remote file over ssh
Replace all: echo "a" | ssh user@host "cat > <file>"
Append: echo "a" | ssh user@host "cat >> <file>"

Nano Stuff

Select Alt-A
Cut CTRL-K


close
Categories

Hi, guest!

settings