Add new data

This commit is contained in:
root
2024-03-02 02:54:33 +03:00
parent ed098b2e6c
commit 8c8a39aef2
17 changed files with 112 additions and 18 deletions

View 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

View File

@@ -8,7 +8,7 @@
# Common
## find
```
```bash
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 HISTSIZE=500000
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=
# 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 m='cd /mnt'
@@ -30,7 +36,6 @@ alias e='cd /etc'
alias l='cd /var/log'
tabs -4
```
## reboot
@@ -44,11 +49,6 @@ echo b > /proc/sysrq-trigger
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
ps --ppid 2 -p 2 --deselect
```

View File

@@ -1,3 +1,4 @@
# Fedora / CentOS / Etc
## Relabel
@@ -6,7 +7,7 @@ touch /.autorelabel
```
## Install PHP 8
```
```bash
dnf install https://rpms.remirepo.net/fedora/remi-release-38.rpm
dnf module reset php
dnf module install php:remi-8.2

17
docs/linux/network.md Normal file
View 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
```

View File

@@ -1,3 +1,8 @@
# RSysLog
## Config
```
$ModLoad imudp
$UDPServerRun 514

View File

@@ -1,5 +1,7 @@
# Nginx
# SELinux
## Nginx
```
# Allow open local port
semanage port -a -t http_port_t -p tcp 28081

View File

@@ -1,3 +1,4 @@
# Аппроксимация функции одной переменной
[https://planetcalc.ru/5992/](https://planetcalc.ru/5992/)

View File

@@ -23,6 +23,4 @@
### | |--------| 0-23 часы
### | |
### |----------| 0-59 минуты
```

12
docs/progs/ffmpeg.md Normal file
View 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
View 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
```

View File

@@ -1,4 +1,6 @@
# Kubernetes
```bash
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

View File

@@ -1,3 +1,4 @@
# MC
## ~/.config/mc/ini

View File

@@ -1,10 +1,12 @@
# Connection start
# NMCli
## Connection start
```bash
nmcli con up ens18
```
# Connection modifity
## Connection modifity
```bash
ifc=eth0 \
nmcli con mod $ifc ipv4.addresses 172.16.23.56/24 && \
@@ -16,12 +18,12 @@ nmcli con up $ifc restart && \
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"); } }'
```
# Connection event
## Connection event
```bash
#!/bin/bash

View File

@@ -1,5 +1,8 @@
# PHP
## Set default timezone
```
```bash
printf '[Date]\ndate.timezone = Asia/Katmandu\n' > /etc/php.d/17-cmp-timezone.ini
```

View File

@@ -1,4 +1,6 @@
# Socat
```bash
socat PTY,link=/dev/vmodem0,echo=0,waitslave TCP:10.0.0.1:333
```

View File

@@ -1,7 +1,8 @@
# SSH
## Generate public key from private
```
```bash
ssh-keygen -f id_rsa -y > id_rsa.pub
```

7
docs/progs/termux.md Normal file
View File

@@ -0,0 +1,7 @@
# Termux
## Config ~/.termux/termux.properties
```
extra-keys = [['ESC','/','-','HOME','UP','END','PGUP'],['TAB','CTRL','ALT','LEFT','DOWN','RIGHT','PGDN']]
```