This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The command below creates a tgz file with all emails for [email protected] in .eml format: | |
# execute as root | |
/opt/zimbra/bin/zmmailbox -z -m [email protected] getRestURL "//?fmt=tgz" > /tmp/account.tgz | |
# You can do the same via a REST URL: | |
wget http://ZIMBRA.SERVER/home/[email protected]/?fmt=tgz | |
# to restore email: | |
/opt/zimbra/bin/zmmailbox -z -m [email protected] postRestURL "//?fmt=tgz&resolve=reset" /tmp/account.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Need to run manual paste command | |
### Create snapshot | |
lvcreate -L50G -s -n centos-disk-snapshot /dev/sanbox-vg/centos-disk-fresh | |
### Restore snapshot | |
lvconvert --merge /dev/sanbox-vg/centos-disk-snapshot | |
lvchange -an /dev/sanbox-vg/centos-disk-fresh | |
lvchange -ay /dev/sanbox-vg/centos-disk-fresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install related library | |
sudo apt install git intltool libtool network-manager-dev libnm-util-dev libnm-glib-dev libnm-glib-vpn-dev libnm-gtk-dev libnm-dev libnma-dev ppp-dev libdbus-glib-1-dev libsecret-1-dev libgtk-3-dev libglib2.0-dev xl2tpd strongswan libnss3-dev libssl-dev | |
git clone https://github.com/nm-l2tp/network-manager-l2tp.git | |
cd network-manager-l2tp | |
autoreconf -fi | |
intltoolize | |
./configure \ | |
--disable-static --prefix=/usr \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u www-data /usr/bin/php -f /var/www/html/owncloud/occ user:list --output=json --attributes=uid | jq 'del(.freakie)' | jq -r 'keys | .[]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install plugin | |
bundle config set without 'development test' | |
bundle config set path 'vendor/bundle' | |
bundle install | |
bundle exec rake redmine:plugins NAME=redmine_checklists RAILS_ENV=production | |
touch tmp/restart.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; create file in /var/named/example.com | |
; example.com | |
$TTL 3600 | |
example.com. IN SOA ns1.example.com. [email protected]. ( | |
2021062601 ; Serial | |
3H ; refresh after 3 hours | |
1H ; retry after 1 hour | |
1W ; expire after 1 week | |
1D) ; minimum TTL of 1 day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2016 Faizal Sadri | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VG_GROUP=geekha | |
LV_NAME=www1-disk | |
DATE="$(date +%Y_%m_%d-%H%M)" | |
LV_TAG=snapshot | |
SIZE=20G | |
# retention copy | |
COPY=3 | |
lvcreate -L$SIZE -s -n $LV_NAME-$LV_TAG-$DATE /dev/$VG_GROUP/$LV_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CMD="$(dirname $0)/$(basename $0)" | |
if [ $# -ne 2 ]; then | |
echo "${CMD} <ip> <port>" | |
else | |
echo > /dev/tcp/$1/$2 && echo "open" | |
fi | |
#echo > /dev/tcp/192.168.1.41/9100 && echo "open" |