Difference between revisions of "Command Snips"

From copec
Jump to: navigation, search
(RAID)
Line 32: Line 32:
 
  mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
 
  mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
 
  mdadm --detail --scan >> /etc/mdadm/mdadm.conf
 
  mdadm --detail --scan >> /etc/mdadm/mdadm.conf
 +
 +
== Mirror Website ==
 +
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org

Revision as of 13:32, 31 August 2017

Shell

Date String Stamp

`date '+%Y-%m-%d-%Hh%M'`

Lock gnome >3.8 remote

DISPLAY=:0 dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock

Re-Mount / RW

I always forget the exact syntax...

mount -o remount,rw /

MySQL

Create New Database and User

For database 'new_db_name' and user 'new_user':

mysql --defaults-file=/etc/mysql/debian.cnf 
CREATE DATABASE new_db_name;
CREATE USER 'new_user'@'localhost' IDENTIFIED BY 'good_password';
GRANT ALL PRIVILEGES ON new_db_name.* TO 'new_user'@'localhost';
FLUSH PRIVILEGES;

Update User Password

SET PASSWORD FOR 'username'@'%.example.com' = PASSWORD('good_password');

OpenSSL Testing

https://easyengine.io/tutorials/mail/server/testing/smtp/

RAID

mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Mirror Website

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org