start new:
tmux
start new with session name:
tmux new -s myname
# Install Ubiquiti Unifi Controller on Ubuntu 20.04. | |
# As tested on a fresh install of ubuntu-20.04.1-live-server, August 22nd 2020. | |
# Thanks to https://gist.github.com/tmuncks for posting the updated install steps. | |
sudo apt update | |
sudo apt install --yes apt-transport-https | |
echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.list | |
sudo wget -O /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg |
{ | |
"name": "uploadcare/custom-s3", | |
"description": "Custom S3 storage example", | |
"license": "MIT", | |
"authors": [ | |
{ | |
"name": "Dmitry Mukhin", | |
"email": "[email protected]" | |
} | |
], |
#Migrate i-mscp to a new server | |
#the new imscp is already installed and does have a different IP than the old one | |
#1. Dump the DB and copy the i-MSCP backup to new server: | |
rsync -rave "ssh -l root" /var/www/imscp/backups 10.0.0.3:/var/tmp/imscp_old_backups | |
#2.Install the old config DB | |
#3. Copy all customer data: | |
rsync -rave "ssh -l root " /var/www/virtual/ 10.0.0.3:/var/www/virtual |
{ | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket_name_here/*" |
<?php | |
$randomValue = mt_rand(); | |
$even = $randomValue & ~1; | |
$odd = $randomValue | 1; | |
// magical unicorn isn't it? |
ssh [email protected] | |
vi /etc/ssh/sshd_config | |
# override default of no subsystems | |
#Subsystem sftp /usr/libexec/sftp-server | |
Subsystem sftp internal-sftp | |
# restart ssh |
<?php | |
// secure hashing of passwords using bcrypt, needs PHP 5.3+ | |
// see http://codahale.com/how-to-safely-store-a-password/ | |
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt | |
$salt = substr(strtr(base64_encode(openssl_random_pseudo_bytes(22)), '+', '.'), 0, 22); | |
// 2y is the bcrypt algorithm selector, see http://php.net/crypt | |
// 12 is the workload factor (around 300ms on my Core i7 machine), see http://php.net/crypt |
<?PHP | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |