/
bear
/
my_snippets
Обзор
Документация
Войти
/
bear
/
my_snippets
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
data/linux_commands.xml
23 строки
4 KB
Nikita Kalitin
add(.xml): linux_commands: chagne rights, laravel: clear-cache route
11 мар 2020, 10:43
11 мар 2020, 10:43
d6796d4
Код
Авторство
О чём код?
<templateSet group="linux_commands"> <template name="mysqldump" value="### ---------------------------- mysqldump --single-transaction -u <$USERNAME> -h localhost -p<$PASSKEY> <$DBNAME> | gzip -9 > backup_<DBNAME>.`date +%d-%m-%Y_%H-%M`.sql.gz ### ----------------------------" description="backup mysql database" toReformat="false" toShortenFQNames="true"> <context> <option name="Bash" value="true" /> </context> </template> <template name="mount_network_drive" value="### ------------------------------------- sudo -S mkdir /mnt/sharedfolder/ sudo -S mount -t cifs -w -o username=nabed -o password=nabed //192.168.0.58/sharedfolder /mnt/sharedfolder/ ### -------------------------------------" description="mount network drive (samba)" toReformat="false" toShortenFQNames="true" /> <template name="scp_files" value="### ------------------------------------------------------------------ ### from: scp <user_name>@<server_name.ru>:<full_path_to_server's file> <local path to file ex: ./> ### --------------- ### to scp <path_to_file_src> <user_name>@<server>:<path_to_file_dest> ### ------------------------------------------------------------------" description="copy file to server throw ssh" toReformat="false" toShortenFQNames="true" /> <template name="ssh-generate" value="### ------------------------------------------------------- $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ### -------------------------------------------------------" description="generat rsa key (from github man)" toReformat="false" toShortenFQNames="true" /> <template name="cp_dir" value="#------------------------ cp -a /source/. /dest/ #------------------------ " description="copy one drictory to another" toReformat="false" toShortenFQNames="true"> <context> <option name="Bash" value="true" /> </context> </template> <template name="cp_and_overwrite" value="#----------------------------------------- cp -Rv --remove-destination <./src/*> <./dest> #-----------------------------------------" description="copy and overwrite if exist" toReformat="false" toShortenFQNames="true" /> <template name="ssh_by_pass" value="# connect to ssh server use password ssh -o IdentitiesOnly=yes <username>@<address>" description="connect use password" toReformat="false" toShortenFQNames="true"> <context> <option name="Bash" value="true" /> </context> </template> <template name="ip" value="#How do i change the state of the device to UP or DOWN ip link set dev {device} {up|down} #for example: ip link set dev eth1 down ip link set dev eth1 up -#------------------------ ip addr ip l #assign the IP address to the interface ip a add {ip_addr/mask} dev {interface} #table Object		Abbreviated form	Purpose link			l					Network device. address		a addr								Protocol (IP or IPv6) address on a device. addrlabel		addrl				Label configuration for protocol address selection. neighbour	n neigh								ARP or NDISC cache entry. route			r					Routing table entry. rule			ru					Rule in routing policy database. maddress		m maddr								Multicast address. mroute		mr					Multicast routing cache entry. tunnel			t					Tunnel over IP. xfrm			x					Framework for IPsec protocol." description="ip commands network" toReformat="false" toShortenFQNames="true" /> <template name="change_rights" value="# например заходим в .git, от root запускать # меняем права на все директории find . -type d -exec chmod 775 {} \; # меняем права на все файлы find . -type f -exec chmod 664 {} \; # меняем владельца chown -R root:www . -----------------------------------------------------------------------" description="change rights for folder and subfolders in current dir" toReformat="false" toShortenFQNames="true" /> </templateSet>