Skip to content

Instantly share code, notes, and snippets.

View rhamdeew's full-sized avatar
🏠
Working from home

Rail rhamdeew

🏠
Working from home
View GitHub Profile
@rhamdeew
rhamdeew / gist:cf583391a2ec5457866a
Created August 18, 2014 14:34
Lftp синхронизация каталога на сервере без перезаливки имеющихся файлов
open login:password@ftp.site.ru
mirror --reverse --delete --use-cache --verbose --only-missing --allow-chown --allow-suid --no-umask --parallel=2 --dereference /localdir dir
exit
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP &&
iptables -A INPUT -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j DROP &&
iptables -A INPUT -i lo -j ACCEPT &&
iptables -D INPUT -p tcp -m tcp --dport 21 -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --dport 1989 -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --dport 1500 -j ACCEPT &&
iptables -A INPUT -p tcp -m tcp --dport 18080 -j ACCEPT &&
@rhamdeew
rhamdeew / gist:a218aa6fd903fec4c534
Created January 26, 2015 19:14
bitrix .gitignore sample
*.komodoproject
.buildpath
.project
.settings
sitemap*.xml
awstats.*
*.sh
#symlinks
site.ru/bitrix

Keybase proof

I hereby claim:

  • I am rhamdeew on github.
  • I am rhamdeew (https://keybase.io/rhamdeew) on keybase.
  • I have a public key whose fingerprint is FE7D 5487 D0E9 264A 18DD A14E 5201 4492 E8E0 032C

To claim this, I am signing this object:

Понадобилось тут мне быстро скачать готовый образ с CentOS и запустить его в Qemu KVM.
Скачал образ в qcow2, создал виртуалку с этим образом, запустил. Все вроде бы ок, но пароль рута отсутствует.
В официальной документации от RedHat также нигде он не написан, зато предлагают подправить опции в Grub и загрузиться
в Single-mode. Этот вариант я попробовал, но в итоге все равно получил запрос на авторизацию.
Короче беда какая-то...
Оказалось что все это можно очень просто решить при помощи virt-sysprep:
@rhamdeew
rhamdeew / gist:3e3a4b4d134bb876de715fee908ab34f
Created July 9, 2018 14:47
Linux us,ru layout with 3rd level on right alt
setxkbmap -option "lv3:ralt_switch, misc:typo" -option grp:alt_shift_toggle "us,ru"
@rhamdeew
rhamdeew / ruby.json
Last active November 29, 2021 10:39
Ruby snippets for VS Code
{
"Byebug": {
"prefix": "bb",
"body": [
"byebug",
],
"description": "Place debugger breakpoint"
},
"Screenshot and save": {
"prefix": "ss",
@rhamdeew
rhamdeew / backup-excludes.conf
Last active June 23, 2023 12:54
Vesta CP. Example of /usr/local/vesta/data/users/%user%/backup-excludes.conf to correctly ignore dirs for multiple domains
WEB='site1.ru:public_html/bitrix/cache:public_html/bitrix/backup:public_html/upload/tmp:public_html/upload/resize_cache,site2.ru:public_html/bitrix/cache:public_html/bitrix/backup:public_html/upload/tmp:public_html/upload/resize_cache'
DNS=''
MAIL=''
DB=''
CRON=''
USER=''