Create a script file night_mode
#!/bin/sh
night_mode() {
xrandr --output VGA-1 --gamma $1 --brightness $2
}
case $1 in
off) night_mode 1:1:1 1.0 ;;
*) night_mode 1:0.85:0.6 1.0 ;;
esac
Create a script file night_mode
#!/bin/sh
night_mode() {
xrandr --output VGA-1 --gamma $1 --brightness $2
}
case $1 in
off) night_mode 1:1:1 1.0 ;;
*) night_mode 1:0.85:0.6 1.0 ;;
esac
Assume we have 2 partitions: /dev/fedora/root
and /dev/fedora/home
, want to reduce the size of root and give it for home.
Boot to live boot USB.
Ensure that partitions are not mounted.
[Read More]Create a systemd drop-in directory for the docker service
$ sudo mkdir -p /etc/systemd/system/docker.service.d
Add proxy configuration into /etc/systemd/system/docker.service.d/http-proxy.conf
(create if not exist)
[Service]
Environment="HTTP_PROXY=<your_proxy>"
Environment="HTTPS_PROXY=<your_proxy>/"
Environment="NO_PROXY=localhost,127.0.0.1"
Flush change and restart service
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
Install ncat
# For Debian 8
$ sudo apt-get install nmap
# For Debian 10
$ sudo apt install ncat
# For Redhat based OS
$ sudo yum install nmap-ncat
# or
$ sudo dnf install nmap-ncat
Update file /etc/apt/sources.list
deb http://archive.debian.org/debian <code_name> main contrib non-free
# For example
# deb http://archive.debian.org/debian squeeze main contrib non-free
Ignore check Release file expired
$ echo 'Acquire::Check-Valid-Until "false";' | sudo tee /etc/apt/apt.conf.d/90ignore-release-date
Use sed
and md5sum
$ sed -n <begin_line>,<end_line>p <file_name> | md5sum
For example, to get checksum from line 2 to line 15 in a file sample.txt
$ sed -n 2,15p sample.txt | md5sum
With newer version of losetup, you can easy map parition in image file to /dev/loop*.
$ sudo losetup --show -Pf <imagefile>
/dev/loop0
The output will show which loop device has been mapped to image file. Now you can mount partition of it.
Example:
$ sudo mount /dev/loop0p1 /mnt
If ssh key (~/.ssh/id_rsa*) is not available, create new
$ ssh-keygen
Copy the public key to remote host
$ ssh-copy-id -i ~/.ssh/id_rsa.pub <user>@<remote-host>
For read from pipe:
$ alias less="vim -u /usr/share/vim/vim*/macros/less.vim -"
For read from file:
$ alias fless="vim -u /usr/share/vim/vim*/macros/less.vim"