Add new data
This commit is contained in:
14
docs/linux/cmp-iptables.service
Normal file
14
docs/linux/cmp-iptables.service
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Apply iptables rules
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
# EnvironmentFile=/etc/default/firewall
|
||||||
|
ExecStart=/root/bin/cmp-iptables-start.sh
|
||||||
|
RemainAfterExit=true
|
||||||
|
ExecStop=/root/bin/cmp-iptables-stop.sh
|
||||||
|
StandardOutput=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@@ -8,7 +8,7 @@
|
|||||||
# Common
|
# Common
|
||||||
|
|
||||||
## find
|
## find
|
||||||
```
|
```bash
|
||||||
find /var -maxdepth 2 -type d -printf "%TY-%Tm-%Td %TH:%TM:%TS %Tz %p\n"
|
find /var -maxdepth 2 -type d -printf "%TY-%Tm-%Td %TH:%TM:%TS %Tz %p\n"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -20,9 +20,15 @@ export EDITOR=mcedit
|
|||||||
export HISTFILESIZE=10485760
|
export HISTFILESIZE=10485760
|
||||||
export HISTSIZE=500000
|
export HISTSIZE=500000
|
||||||
export HISTCONTROL=ignoreboth:erasedups
|
export HISTCONTROL=ignoreboth:erasedups
|
||||||
export HISTIGNORE="history:reboot:poweroff:cd:ls:pwd:mc:ps:m:e:l"
|
export HISTIGNORE="history:reboot:poweroff:cd:ls:pwd:mc:ps:m:e:l:z:zz:zzz"
|
||||||
export SSH_ASKPASS=
|
export SSH_ASKPASS=
|
||||||
|
|
||||||
|
# PS1 Green
|
||||||
|
# PS1='[\[\e[32m\]\u@\h\[\e[0m\] \[\e[32m\]\W\[\e[0;31m\]\[\e[0m\]]\$ '
|
||||||
|
|
||||||
|
# PS1 Default
|
||||||
|
# PS1='[\u@\h \W]\$ '
|
||||||
|
|
||||||
alias ffi='ffmpeg -hide_banner -i'
|
alias ffi='ffmpeg -hide_banner -i'
|
||||||
|
|
||||||
alias m='cd /mnt'
|
alias m='cd /mnt'
|
||||||
@@ -30,7 +36,6 @@ alias e='cd /etc'
|
|||||||
alias l='cd /var/log'
|
alias l='cd /var/log'
|
||||||
|
|
||||||
tabs -4
|
tabs -4
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## reboot
|
## reboot
|
||||||
@@ -44,11 +49,6 @@ echo b > /proc/sysrq-trigger
|
|||||||
cat /sys/devices/virtual/dmi/id/board_name
|
cat /sys/devices/virtual/dmi/id/board_name
|
||||||
```
|
```
|
||||||
|
|
||||||
## grab video from screen
|
|
||||||
```bash
|
|
||||||
ffmpeg -s 1920x1080 -framerate 10 -f x11grab -i :0 -qscale 6 out.mkv
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ps --ppid 2 -p 2 --deselect
|
ps --ppid 2 -p 2 --deselect
|
||||||
```
|
```
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# Fedora / CentOS / Etc
|
# Fedora / CentOS / Etc
|
||||||
|
|
||||||
## Relabel
|
## Relabel
|
||||||
@@ -6,7 +7,7 @@ touch /.autorelabel
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Install PHP 8
|
## Install PHP 8
|
||||||
```
|
```bash
|
||||||
dnf install https://rpms.remirepo.net/fedora/remi-release-38.rpm
|
dnf install https://rpms.remirepo.net/fedora/remi-release-38.rpm
|
||||||
dnf module reset php
|
dnf module reset php
|
||||||
dnf module install php:remi-8.2
|
dnf module install php:remi-8.2
|
||||||
|
17
docs/linux/network.md
Normal file
17
docs/linux/network.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
# Network
|
||||||
|
|
||||||
|
## ipset
|
||||||
|
```bash
|
||||||
|
# Create ip-list with timeout
|
||||||
|
ipset create ipl-name hash:ip timeout 3600
|
||||||
|
```
|
||||||
|
|
||||||
|
## iptables
|
||||||
|
```bash
|
||||||
|
# Show current rules
|
||||||
|
iptables -L -vn
|
||||||
|
|
||||||
|
# Fix TTL for mobile network
|
||||||
|
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 65
|
||||||
|
```
|
@@ -1,3 +1,8 @@
|
|||||||
|
|
||||||
|
# RSysLog
|
||||||
|
|
||||||
|
## Config
|
||||||
|
|
||||||
```
|
```
|
||||||
$ModLoad imudp
|
$ModLoad imudp
|
||||||
$UDPServerRun 514
|
$UDPServerRun 514
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
# Nginx
|
# SELinux
|
||||||
|
|
||||||
|
## Nginx
|
||||||
```
|
```
|
||||||
# Allow open local port
|
# Allow open local port
|
||||||
semanage port -a -t http_port_t -p tcp 28081
|
semanage port -a -t http_port_t -p tcp 28081
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# Аппроксимация функции одной переменной
|
# Аппроксимация функции одной переменной
|
||||||
|
|
||||||
[https://planetcalc.ru/5992/](https://planetcalc.ru/5992/)
|
[https://planetcalc.ru/5992/](https://planetcalc.ru/5992/)
|
||||||
|
@@ -23,6 +23,4 @@
|
|||||||
### | |--------| 0-23 часы
|
### | |--------| 0-23 часы
|
||||||
### | |
|
### | |
|
||||||
### |----------| 0-59 минуты
|
### |----------| 0-59 минуты
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
12
docs/progs/ffmpeg.md
Normal file
12
docs/progs/ffmpeg.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
# FFmpeg
|
||||||
|
|
||||||
|
## Crop video to 720x520 begin from 0:280
|
||||||
|
```bash
|
||||||
|
ffi in.mov -vf "crop=720:520:0:280" -c:v libx264 -c:a copy -b:v 1200k out.mp4
|
||||||
|
```
|
||||||
|
|
||||||
|
## Grab video from screen
|
||||||
|
```bash
|
||||||
|
ffmpeg -s 1920x1080 -framerate 10 -f x11grab -i :0 -qscale 6 out.mkv
|
||||||
|
```
|
26
docs/progs/git.md
Normal file
26
docs/progs/git.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
# GIT
|
||||||
|
|
||||||
|
## Remote control
|
||||||
|
```bash
|
||||||
|
git remote -v
|
||||||
|
git remote add origin https://site/repo.git
|
||||||
|
git remote set-url origin https://site/repo.git
|
||||||
|
```
|
||||||
|
|
||||||
|
## Config ~/.gitconfig
|
||||||
|
```ini
|
||||||
|
[user]
|
||||||
|
email = user@gmail.com
|
||||||
|
|
||||||
|
[alias]
|
||||||
|
aa = !git add -A && git status -v
|
||||||
|
up = push
|
||||||
|
st = status -v
|
||||||
|
sta = status -v
|
||||||
|
cam = commit -am
|
||||||
|
last = log -1 HEAD
|
||||||
|
|
||||||
|
[safe]
|
||||||
|
directory = /mnt/data/src
|
||||||
|
```
|
@@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
# Kubernetes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p $HOME/.kube
|
mkdir -p $HOME/.kube
|
||||||
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
# MC
|
# MC
|
||||||
|
|
||||||
## ~/.config/mc/ini
|
## ~/.config/mc/ini
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
|
|
||||||
# Connection start
|
# NMCli
|
||||||
|
|
||||||
|
## Connection start
|
||||||
```bash
|
```bash
|
||||||
nmcli con up ens18
|
nmcli con up ens18
|
||||||
```
|
```
|
||||||
|
|
||||||
# Connection modifity
|
## Connection modifity
|
||||||
```bash
|
```bash
|
||||||
ifc=eth0 \
|
ifc=eth0 \
|
||||||
nmcli con mod $ifc ipv4.addresses 172.16.23.56/24 && \
|
nmcli con mod $ifc ipv4.addresses 172.16.23.56/24 && \
|
||||||
@@ -16,12 +18,12 @@ nmcli con up $ifc restart && \
|
|||||||
true
|
true
|
||||||
```
|
```
|
||||||
|
|
||||||
# Disable IPv6 for all
|
## Disable IPv6 for all
|
||||||
```
|
```
|
||||||
nmcli con show | awk '{if(NR > 1) { print $1; system("nmcli con mod " $1 " ipv6.method disable"); } }'
|
nmcli con show | awk '{if(NR > 1) { print $1; system("nmcli con mod " $1 " ipv6.method disable"); } }'
|
||||||
```
|
```
|
||||||
|
|
||||||
# Connection event
|
## Connection event
|
||||||
```bash
|
```bash
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
|
|
||||||
|
# PHP
|
||||||
|
|
||||||
## Set default timezone
|
## Set default timezone
|
||||||
```
|
|
||||||
|
```bash
|
||||||
printf '[Date]\ndate.timezone = Asia/Katmandu\n' > /etc/php.d/17-cmp-timezone.ini
|
printf '[Date]\ndate.timezone = Asia/Katmandu\n' > /etc/php.d/17-cmp-timezone.ini
|
||||||
```
|
```
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
# Socat
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
socat PTY,link=/dev/vmodem0,echo=0,waitslave TCP:10.0.0.1:333
|
socat PTY,link=/dev/vmodem0,echo=0,waitslave TCP:10.0.0.1:333
|
||||||
```
|
```
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
|
|
||||||
# SSH
|
# SSH
|
||||||
|
|
||||||
## Generate public key from private
|
## Generate public key from private
|
||||||
```
|
```bash
|
||||||
ssh-keygen -f id_rsa -y > id_rsa.pub
|
ssh-keygen -f id_rsa -y > id_rsa.pub
|
||||||
```
|
```
|
||||||
|
|
||||||
|
7
docs/progs/termux.md
Normal file
7
docs/progs/termux.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
# Termux
|
||||||
|
|
||||||
|
## Config ~/.termux/termux.properties
|
||||||
|
```
|
||||||
|
extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]
|
||||||
|
```
|
Reference in New Issue
Block a user