Archive for the Linux Category

Feb 26 2015

gammu sending sms

gammu sendsms TEXT 048123456789 -text "Halooo .."

Feb 20 2015

If your SSL certificate was received in DER format, here is the command to convert it to PEM:

openssl x509 -in signed_cert.der -inform DER -out server.crt

Feb 6 2015

compiling mariadb 10.0 on Slackware

add option
-DWITH_JEMALLOC=NO
to slackbuild

May 15 2014

HDD check on linux

1. Check HDD for bad block
sudo badblocks -v /dev/sda1 > bad-blocks
2. Pass the file to fsck
sudo fsck -t ext4 -l bad-blocks /dev/sda1

Jan 15 2014

clamdscan

Przykład clamdscan
sudo -u clamav clamdscan /home/ftp/samba_public/

Jan 15 2014

Linux random password

in bash script
tr -dc A-Za-z0-9_ < /dev/urandom | head -c 16 | xargs

function in $HOME/.bashrc
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs }

Dec 20 2013

PHP Warning: preg_match(): Compilation failed: support for \P, \p, and \X has not been compiled

recompile pcre with option

–enable-utf8 –enable-unicode-properties

Oct 23 2013

Upgrade all perl modules via CPAN

cpan -r
or
perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

Sep 6 2013

openfire logs problem

Error: java.io.FileNotFoundException: /logs/debug.log (No such file or directory)

Solution:
edit file “./lib/log4j.xml” and replace “{$openfireHome}” with absolute path to logs

Mar 14 2013

fail2ban mysql

Dodaj kod do
/usr/share/fail2ban/server/datedetector.py

# AAMMJJ HH:MM:SS
template = DateStrptime()
template.setName("YearMonthDay Hour:Minute:Second")
template.setRegex("\d{2}\d{2}\d{2} \d{2}:\d{2}:\d{2}")
template.setPattern("%y%m%d %H:%M:%S")
self.__templates.append(template)

# cat /etc/fail2ban/filter.d/mysqld.conf

Fail2Ban configuration file
#
# Author: Darel
#

[Definition]
failregex = Access denied for user ‘.*’@’