четверг, 4 декабря 2014 г.

Ускоряем загрузку или проблема с DHCPDISCOVER

При загрузке очень долго тупит на моменте DHCPDISCOVER - для решения необходимо изменить скрипт инциализации для продолжения в фоновом режиме.

Для этого необходимо выделить то, что происходит при вызове команды start  в отдельный метод.



start_on_boot() {
        if init_is_upstart; then                exit 1
        fi        process_options
        check_ifstate
        if [ "$CONFIGURE_INTERFACES" = no ]        then            log_action_msg "Not configuring network interfaces, see /etc/default/networking"            exit 0
        fi        set -f        exclusions=$(process_exclusions)        log_action_begin_msg "Configuring network interfaces"        if ifup -a $exclusions $verbose && ifup_hotplug $exclusions $verbose        then            log_action_end_msg $?        else            log_action_end_msg $?        fi}

case "$1" in
start)        start_on_boot() &        ;;

пятница, 15 августа 2014 г.

deleting xenserver templates

Набросал скрипт для удаления темплэйтов из ксенсервера.

https://github.com/KOPACb/XenHelp/blob/master/script/del_template.sh

среда, 11 июня 2014 г.

Google Chrome & Win8

Наблюдал проблему: когда скролишь страницу скрол иногда заедало... т.е. листаешь вниз, а страничка "перекидывает" тебя к какому-то месту случайному.

Залез в chrome://flags/ и включил опции 
"Быстрая прокрутка содержания, выходящего за границы блока"
"Ускорение прокрутки в контейнерах"Пока что тестирую, но вроде - бы бага ушла.


Баг 2 - на некоторых сайтах информационная панель ( панель состояния, внизу которая ) при просмотре ролика фуллскрин постоянно вылезает, чем безмерно раздражает. Решение пока что ищу.

понедельник, 7 апреля 2014 г.

Asterisk watchdog

В одной конторке астер почему-то валится с ошибкой. В итоге украл такой вот скриптик:



#!/bin/bash
#asterisk watchdog

#!/bin/bash
#asterisk watchdog

PROCESS="asterisk"
PROCCHK=$(ps aux|grep -c $PROCESS)
if [ $PROCCHK -eq 1 ]
then
#/usr/sbin/asterisk
/usr/sbin/service asterisk start
echo "[$(date)]Started Asterisk Service at $(date)" >> /var/log/asterisk/asterisk-check.log
else
echo "[$(date)] $PROCESS is running $PROCCHK processes" >> /var/log/asterisk/asterisk-check.log
fi
exit

вторник, 18 февраля 2014 г.

Dbf 2 excel 2007-2009

Наши замечательные банки, а именно сбербанк, до сих пор работают со странными форматами, и не предоставляют никакой инфы.

Так вот аддон для сохранения в формаде .dbf
http://sourceforge.net/projects/exceltodbf/files/


И да, что-то я совсем не обновляю свой бложик. Надо исправляться.

пятница, 8 ноября 2013 г.

понедельник, 4 ноября 2013 г.

OpenSSL certificate generation script  - как ни крути, полезная штука! Честно украдено у freeRADIUS.
#!/bin/ksh
SSL=/usr/local/openssl

export PATH=${SSL}/bin/:${SSL}/ssl/misc:${PATH}
export LD_LIBRARY_PATH=${SSL}/lib

# needed if you need to start from scratch otherwise the CA.pl -newca command doesn't copy the
new
# private key into the CA directories
rm -rf demoCA

echo "*********************************************************************************"
echo "Creating self-signed private key and certificate"
echo "When prompted override the default value for the Common Name field"
echo "*********************************************************************************"
echo

# Generate a new self-signed certificate.
# After invocation, newreq.pem will contain a private key and certificate
# newreq.pem will be used in the next step
openssl req -new -x509 -keyout newreq.pem -out newreq.pem -days 730 \
 -passin pass:whatever -passout pass:whatever

echo "*********************************************************************************"
echo "Creating a new CA hierarchy (used later by the "ca" command) with the certificate"
echo "and private key created in the last step"
echo "*********************************************************************************"
echo

echo "newreq.pem" | CA.pl -newca >/dev/null

echo "*********************************************************************************"
echo "Creating ROOT CA"
echo "*********************************************************************************"
echo

# Create a PKCS#12 file, using the previously created CA certificate/key
# The certificate in demoCA/cacert.pem is the same as in newreq.pem. Instead of
# using "-in demoCA/cacert.pem" we could have used "-in newreq.pem" and then omitted
# the "-inkey newreq.pem" because newreq.pem contains both the private key and certificate
openssl pkcs12 -export -in demoCA/cacert.pem -inkey newreq.pem -out root.p12 -cacerts \
 -passin pass:whatever -passout pass:whatever

# parse the PKCS#12 file just created and produce a PEM format certificate and key in root.pem
openssl pkcs12 -in root.p12 -out root.pem -passin pass:whatever -passout pass:whatever

# Convert root certificate from PEM format to DER format
openssl x509 -inform PEM -outform DER -in root.pem -out root.der

echo "*********************************************************************************"
echo "Creating client private key and certificate"
echo "When prompted enter the client name in the Common Name field. This is the same"
echo " used as the Username in FreeRADIUS"
echo "*********************************************************************************"
echo

# Request a new PKCS#10 certificate.
# First, newreq.pem will be overwritten with the new certificate request
openssl req -new -keyout newreq.pem -out newreq.pem -days 730 \
 -passin pass:whatever -passout pass:whatever

# Sign the certificate request. The policy is defined in the openssl.cnf file.
# The request generated in the previous step is specified with the -infiles option and
# the output is in newcert.pem
# The -extensions option is necessary to add the OID for the extended key for client
authentication
openssl ca -policy policy_anything -out newcert.pem -passin pass:whatever \
 -key whatever -extensions xpclient_ext -extfile xpextensions \
 -infiles newreq.pem

# Create a PKCS#12 file from the new certificate and its private key found in newreq.pem
# and place in file cert-clt.p12

openssl pkcs12 -export -in newcert.pem -inkey newreq.pem -out cert-clt.p12 -clcerts \
-passin pass:whatever -passout pass:whatever
# parse the PKCS#12 file just created and produce a PEM format certificate and key in cert-clt.pem
openssl pkcs12 -in cert-clt.p12 -out cert-clt.pem -passin pass:whatever -passout pass:whatever
# Convert certificate from PEM format to DER format
openssl x509 -inform PEM -outform DER -in cert-clt.pem -out cert-clt.der
echo "*********************************************************************************"
echo "Creating server private key and certificate"
echo "When prompted enter the server name in the Common Name field."
echo "*********************************************************************************"
echo
# Request a new PKCS#10 certificate.
# First, newreq.pem will be overwritten with the new certificate request
openssl req -new -keyout newreq.pem -out newreq.pem -days 730 \
-passin pass:whatever -passout pass:whatever
# Sign the certificate request. The policy is defined in the openssl.cnf file.
# The request generated in the previous step is specified with the -infiles option and
# the output is in newcert.pem
# The -extensions option is necessary to add the OID for the extended key for server authentication
openssl ca -policy policy_anything -out newcert.pem -passin pass:whatever -key whatever \
-extensions xpserver_ext -extfile xpextensions -infiles newreq.pem
# Create a PKCS#12 file from the new certificate and its private key found in newreq.pem
# and place in file cert-srv.p12
openssl pkcs12 -export -in newcert.pem -inkey newreq.pem -out cert-srv.p12 -clcerts \
-passin pass:whatever -passout pass:whatever
# parse the PKCS#12 file just created and produce a PEM format certificate and key in cert-srv.pem
openssl pkcs12 -in cert-srv.p12 -out cert-srv.pem -passin pass:whatever -passout pass:whatever
# Convert certificate from PEM format to DER format
openssl x509 -inform PEM -outform DER -in cert-srv.pem -out cert-srv.der
#clean up
rm newcert.pem newreq.pem
10. OpenSSL extensions file
[ xpclient_ext]
extendedKeyUsage = 1.3.6.1.5.5.7.3.2
[ xpserver_ext ]
extendedKeyUsage = 1.3.6.1.5.5.7.3.1