Skip to content

Instantly share code, notes, and snippets.

View Max95Cohen's full-sized avatar

Max Cohen Max95Cohen

View GitHub Profile
@Max95Cohen
Max95Cohen / .bashrc
Last active July 16, 2024 03:12
.bashrc doker-compose bash script
alias compose-ps="docker ps --format 'table {{ .Names }}\t{{ .Status }}\t{{ .Label \"com.docker.compose.project\" }}\t{{ .Label \"com.docker.compose.service\" }}\t{{ .Label \"com.docker.compose.project.working_dir\" }}'"
alias dps="docker ps -a --format 'ID: {{.ID}}\nNames: {{.Names}}\nProject: {{.Label \"com.docker.compose.project\"}}\nPorts: {{.Ports}}\nStatus: {{.Status}}\n'"
dc() {
project=$1
container=$2
check=echo $project | grep "laravel"
if [ -z $check ]; then
@Max95Cohen
Max95Cohen / ufw.conf
Last active May 15, 2024 07:23
ufw config
IPV6=no
ufw allow 11200:11299/tcp
@Max95Cohen
Max95Cohen / netplan
Last active September 10, 2024 13:06
netplan config
$ sudo netplan generate
$ sudo netplan apply
$ sudo netplan --debug apply
$ sudo vim /etc/netplan/50-cloud-init.yaml
# Dynamic IP address assignment (DHCP client) examples;
network:
version: 2
renderer: networkd
ethernets:
@Max95Cohen
Max95Cohen / proftpd
Created February 28, 2023 10:33
proftpd config
AuthUserFile /etc/proftpd.passwd
RequireValidShell off
ListOptions -la
PassivePorts 12000 12100
MasqueradeAddress 111.112.10.11
@Max95Cohen
Max95Cohen / nmap
Created February 23, 2023 09:47
nmap config
nmap -Av -sT 10.10.10.20
@Max95Cohen
Max95Cohen / vsftp
Last active September 15, 2023 03:27
vsftp config
listen_port=2221
local_umask=002
pasv_enable=YES
pasv_max_port=50000
pasv_min_port=40000
pasv_address=111.112.11.12
pasv_addr_resolve=NO
listen_ipv6=no
@Max95Cohen
Max95Cohen / linux
Last active February 20, 2023 07:25
Linux
[[ -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
@Max95Cohen
Max95Cohen / .htaccess
Created February 20, 2023 03:08
.htaccess CMS
# 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]
@Max95Cohen
Max95Cohen / editor
Created February 15, 2023 12:27
ubuntu default editor
sudo select-editor
sudo update-alternatives --config editor
@Max95Cohen
Max95Cohen / swap
Created February 14, 2023 08:35
swap tips
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