This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx | |
# A job stop of running process... | |
$ sudo dpkg-reconfigure tzdata | |
# install putty tools | |
sudo apt install putty-tools | |
# .pem to .ppk convert | |
puttyget file.pemo -o file.ppk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# QueryString алып тыстау керек. ?a=b | |
Route::path() - Route::any('/system/users/:operation/:ID', 'system'); "/system/users" деген жолды алып береді. | |
RewriteCond %{REQUEST_URI} !-d | |
RewriteRule ^(.*/\w+[^/])$ /$1/ [L,R] | |
RewriteCond %{REQUEST_URI} ^/system[^.] | |
RewriteRule ^(.*)$ index.php?$1 [END,QSA] | |
RewriteCond %{REQUEST_URI} ^/$ | |
RewriteRule ^(.*)$ /kz/ [R,END] | |
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9-_]+)\.(css|gif|ico|jpe?g|js|png|woff?2)$ [NC] | |
RewriteRule ^(.*)$ /public/%2/%1.%2 [END] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo select-editor | |
sudo update-alternatives --config editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show swap | |
sudo swapon --show | |
sudo fallocate -l 1G /swapfile | |
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
sudo nano /etc/fstab | |
/swapfile swap swap defaults 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kill sleeped connections | |
for i in `mysql -u root -e "show processlist" | awk '/Sleep/ {print $1}'` ; do mysql -e "KILL $i;"; done | |
MYSQL reset password | |
sudo systemctl stop mysql | |
sudo systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" | |
sudo systemctl start mysql | |
sudo mysql -u root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Local and remote updates | |
local-pc: git reset --hard HEAD~33 | |
local-pc: git push origin +HEAD:master | |
remote-pc: git reset --hard HEAD~33 | |
remote-pc: git pull | |
Reset last push commit | |
git push -f origin last_known_good_commit:branch_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt install bind9 | |
$ cd /etc/bind | |
$ sudo vim named.conf.options | |
forwarders { | |
192.168.1.1; // Local office modem IP address | |
8.8.8.8; | |
}; | |
allow-transfer { | |
192.168.1.1; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i input.jpg -vf scale=320:240 output_320x240.jpg | |
ffmpeg -y -i input.jpg -vf "scale='min(500,iw)':'min(500,ih)'" output_500x500.png | |
ffmpeg -y -i input.jpg -vf "crop=in_h" output_center.png | |
ffmpeg -y -i input.jpg -vf "scale=w='min(500,in_h):h=-1'" output_center1.png | |
ffmpeg -y -i input.jpg -vf "scale=w='min(1000,in_h):h=-1',crop=out_w=in_h,scale=w='min(200,in_h):h=-1" output_center2.png | |
ffmpeg -i input1.mov -vcodec copy -acodec copy out1.mp4 | |
ffmpeg -i input1.mov -q:v 0 output1.mp4 | |
ffmpeg -i input.mkv -codec copy output.mp4 | |
#ffmpeg -i 1000x1250.jpg -vf scale=w=300:h=300:force_original_aspect_ratio=increase,crop=300:300 temp.jpg -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Server autologin | |
cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service | |
[Service] | |
ExecStart=-/sbin/agetty --autologin root --noclear %I | |
# Increase LVM size of root folder / | |
df -h | |
cp -a /home /home2 | |
umount /dev/mapper/centos-home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu welcome text disable | |
sudo chmod -x /etc/update-motd.d/* | |
# Ubuntu remove/hide user from login screen | |
/var/lib/AccountsService/users/XXX | |
[User] | |
SystemAccount=true | |
# Ubuntu Server autologin | |
/etc/systemd/system/getty@tty1.service.d/override.conf |