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
<Directory /var/www/html/secure> | |
AuthBasicProvider ldap | |
AuthLDAPURL "ldap://server1 server2/dc=example,dc=com?sAMAccountName?sub" NONE | |
#AuthLDAPInitialBindAsUser On | |
#AuthLDAPInitialBindPattern (.+) $1@example.com | |
AuthLDAPBindDN user@example.com | |
AuthLdapBindPassword password | |
AuthLDAPGroupAttribute member | |
AuthLDAPGroupAttributeIsDN on | |
AuthType Basic |
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
--from https://www.databasejournal.com/features/oracle/monitoring-tablespace-usage-in-oracle.html | |
set linesize 132 tab off trimspool on | |
set pagesize 105 | |
set pause off | |
set echo off | |
set feedb on | |
column "TOTAL ALLOC (MB)" format 9,999,990.00 | |
column "TOTAL PHYS ALLOC (MB)" format 9,999,990.00 | |
column "USED (MB)" format 9,999,990.00 |
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 OR REPLACE FUNCTION jsoninsert(relname text, reljson json) | |
RETURNS record AS | |
$BODY$DECLARE | |
ret RECORD; | |
inputstring text; | |
BEGIN | |
SELECT string_agg(quote_ident(key),',') INTO inputstring | |
FROM json_object_keys(reljson) AS X (key); | |
EXECUTE 'INSERT INTO '|| quote_ident(relname) | |
|| '(' || inputstring || ') SELECT ' || inputstring |
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 | |
Q="select now() - pg_last_xact_replay_timestamp() < interval '10 seconds',extract (epoch from now() - pg_last_xact_replay_timestamp()) ;" | |
RES=($(echo ${Q} | /usr/bin/psql -tA -Upostgres | tr '|' " ")) | |
STATUS=2 | |
if [ ${RES[0]} == 't' ];then | |
STATUS=0 | |
STATUSTEXT="OK" | |
else |
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
#/etc/systemd/system/[yourService].service.d/[any_name].conf | |
[Unit] | |
Wants=sys-devices-virtual-net-tun0.device | |
After=sys-devices-virtual-net-tun0.device |
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
## for openvpn | |
lxc.mount.entry = /dev/net dev/net none bind,create=dir | |
lxc.cgroup.devices.allow = c 10:200 rwm |
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
network.proxy.autoconfigurl = data:text/plain,function FindProxyForURL(u,h){return "HTTPS host:port";} |
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
ip netns add zukns | |
ip link add veth0 type veth peer name veth1 | |
ip link set veth1 netns zukns | |
ip a add 169.254.69.68/31 dev veth0 | |
ip link set veth0 up | |
ip netns exec zukns ip a add 169.254.69.69/31 dev veth1 | |
ip netns exec zukns ip link set veth1 up | |
ip netns exec zukns ip r add default via 169.254.69.68 | |
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -I POSTROUTING -s 169.254.69.69 -j MASQUERADE |
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
#########SERVER TCP | |
port 1194 | |
proto tcp6 | |
dev tun | |
ca ca.crt | |
cert ${path_to_crt} | |
key ${path_to_key} | |
dh dh.pem | |
server 10.6.0.0 255.255.255.0 | |
ifconfig-pool-persist ipp-tcp.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
#!/bin/bash -e | |
DATA=$(date -I) | |
DEST_DIR=${DEST_DIR} | |
CURRENT_DIR="${DEST_DIR}/${DATA}" | |
mkdir -p $CURRENT_DIR | |
cd $CURRENT_DIR | |
pg_dumpall -Upostgres -g > global.dmp | |
for db in $(psql -Upostgres -At -c 'select datname from pg_database where not datistemplate and datallowconn order by datname');do | |
echo backup ${db} |
NewerOlder