Sometimes I stumble upon interesting commands, settings or procedures that might be useful in the future as well, so I'll document them here and who knows, maybe someone else will find something interesting here as well.
Once Chrome noticed your site using HTTPS it will keep redirecting you to HTTPS even if the webserver doesn't even host HTTPS sites. You can clear the cache and cookies, try to delete the HSTS policy, but nothing works, except this:
Credit gots to Galaxy Internet
Here's a short batch script that allows you to convert a video to a GIF with FFmpeg.
SET filters="fps=%4,scale=%3:-1:flags=lanczos" ffmpeg -v warning -i %1 -vf "%filters%,palettegen" -y palette.png ffmpeg -v warning -i %1 -i palette.png -lavfi "%filters% [x]; [x][1:v] paletteuse" -y %2 DEL palette.png
Usage: togif.bat <input.mp4> <output.gif> <width> <fps>
VariBright is responsible for automatically adjusting the brightness of your display depending on the content shown on the screen. While an interesting idea, it generally doesn't work as expected and leads to a very annoying brightness pumping.
Credit goes to Luke Taylor
C:\Program Files\Logitech Gaming Software\Resources\G930\Manifest\Device_Manifest.xml
turnOffInterval="900"
to 0
or any other time interval in secondshosts
file: %SystemRoot%\System32\drivers\etc\hosts0.0.0.0 ads.viber.com
hosts
file: %SystemRoot%\System32\drivers\etc\hosts0.0.0.0 rad.msn.com 0.0.0.0 apps.skype.com
powercfg /waketimers
taskschd.msc
and press Enterpowercfg /devicequery wake_armed
devmgmt.msc
and press EnterPower Management
tabAllow this device to wake the computer
X:\PortableApps\PortableApps.com\Data
PortableAppsMenu.ini
in your favorite text editorGlobalHotKey
key combinationWhen you use a Windows Key + ← → ↑ ↓ hotkey in Windows 10, you'll get a suggestion of what other window you want to snap. This can be helpful, but is most of the time just annoying and requires you to press ESC. Here's how you disable Snap Assist.
git fetch origin pull/<ID>/head:<BRANCH>
Get disk information
sudo fdisk -l
Partition the disk
parted /dev/sdX mklabel gpt parted /dev/sdX mkpart primary 0% 100% parted /dev/sdX print parted /dev/sdX name 1 CoolName
Format the partition
mkfs -t ext4 -E lazy_itable_init=1 /dev/sdX1
Local
ssh -i ~/.ssh/id_rsa -f -N -R 9999:localhost:22 remote.user@remote.host
Remote
ssh -i ~/.ssh/id_rsa -p 9999 local.user@localhost
AutoSSH Local
autossh -- -i ~/.ssh/id_rsa -o ControlPath none -R 9999:localhost:22 remote.user@remote.host -N
Generate
ssh-keygen -t rsa -b 4096
Upload
ssh-copy-id user@host
OR
cat ~/.ssh/id_rsa.pub | ssh user@host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
See also the GitHub help page and the Digital Ocean help page.
sudo netstat -taupen
Install Node.js
sudo apt-get install nodejs nodejs-legacy
Install NPM - Node Package Manager
curl https://www.npmjs.com/install.sh | sudo sh
Install PM2 - To manage and daemonize Node.js apps
sudo npm install pm2 -g
Start PM2 with the OS
sudo pm2 startup debian
Install proxy mod (might already be installed)
sudo apt-get install libapache2-mod-proxy-html
Create example app
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(8080, '127.0.0.1'); console.log('Server running at http://127.0.0.1:8080/');
Test app
node hello.js
Setup app with PM2
pm2 start hello.js
Additional PM2 commands
pm2 restart <app name> pm2 info <app name> pm2 stop <app name> pm2 list pm2 monit
Activate proxy mod
sudo a2enmod proxy proxy_html sudo service apache2 restart
Adjust virtualhost
<VirtualHost *:80> ServerAdmin admin@domain.tld ServerName domain.tld ServerAlias www.domain.tld ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> <Location /> ProxyPass http://127.0.0.1:8080/ ProxyPassReverse http://127.0.0.1:8080/ </Location> </VirtualHost>
Reload apache configuration
sudo service apache2 reload
For some firewall rules you're required to provide the public IP address. With a dynamic IP you would have to update the firewall rule every time the IP changes, which can be rather annoying and with many rules also time consuming.
Instead it's best to just add a new address list which then can be referenced and if the IP changes there's only one place you need to update.
/ip firewall address-list add address <IP>
The command line will then prompt you for a name, pick something descriptive like for example PUBLIC
.
/ip firewall nat add chain=srcnat src-address=192.168.1.0/24 dst-address=192.168.1.10 protocol=tcp out-interface=bridge1 action=masquerade add chain=dstnat dst-address-list=PUBLIC protocol=tcp dst-port=80880 action=dst-nat to-address=192.168.1.10
EdgeOS is basically a modified Debian system and supports a lot of the commonly known commands.
The most important command or rather key is the ?
. It will list all available commands in the given situation.
With configure
you switch into configuration mode where you can change the router settings. Leave this mode with exit
.
Use commit
to apply changes and save
to write them to disk.
See the CLI Primer (part 1), CLI Primer (part 2) and CLI Primer (part 3) for more useful tips!
sudo killall -SIGHUP lighttpd
curl -O http://...
configure
load /config/config-old.boot
commit
save; exit
For reference and more information see this article.
add system image http://dl.ubnt.com/...
show system image
reboot
For reference and more information see this article.