NTP from scratch

On RHEL 5 the thing to do is this:
awk ‘/^server/ || /^peer/ {print $2}’ /etc/ntp.conf | grep -v ‘127.127.1.0’ > /etc/ntp/step-tickers
chkconfig ntpd on

On RHEL 6:
chkconfig ntpdate on

On RHEL 7:
systemctl enable ntpdate.service

Posted in wrk | Leave a comment

Solar tmp magic!

This example shows how I grew the 2GB mounted /tmp to 3GB on a Solaris 10 5/09 u7 SPARC system. Please, don’t try this in your system.

If you don’t listen to me then keep in mind that the HEXA numbers might differ on your system.

#1. Get the relevant info of the /tmp

# df -h /tmp
Filesystem size used avail capacity Mounted on
swap 2.0G 272K 2.0G 1% /tmp

# echo “::fsinfo” | mdb -k | egrep “VFSP|/tmp”
VFSP FS MOUNT
000003000f46d840 tmpfs /tmp

# Get the address of the tm_anonmax to set its value.
# echo “000003000f46d840::print vfs_t vfs_data | ::print -ta struct tmount tm_anonmax” | mdb -k
3000f488d00 tm_anonmax = 0x40000
// Address and the currrent value of the tm_anonmax

### 2. Set the new value
# echo “3000f488d00/Z 0x60000″ | mdb -kw
0x3000f488d00: 0x40000 = 0x60000
NOTE: the 0x60000 is 384KB -> 384KB * 8KB = 3072MB = 3GB.

### 3. Check if it’s set.
# echo “3000f488d00/J” | mdb -k
0x3000f488d00: 60000
OR
# echo “3000f46d840::print vfs_t vfs_data | ::print struct tmount tm_anonmax” | mdb -k
tm_anonmax = 0x60000

### 4. Check if it’s working or not.
# df -h /tmp
Filesystem size used avail capacity Mounted on
swap 3.0G 272K 3.0G 1% /tmp

Posted in Uncategorized | Leave a comment

Joomla Direct Links

edit vhost.conf

try_files $uri $uri/ /index.php?q=$uri&$args;
error_page 404 = @joomla;
}

location @joomla {
rewrite ^(.*)$ /index.php?q=$1 last;
}

Posted in wrk | Leave a comment

SNMP interface

Source: net-snmp
< agentAddress udp:0.0.0.0:161 < #udp:127.0.0.1:161 < sysServices 78 --- > sysServices 72
rocommunity public default
#-V systemonly

Posted in Uncategorized | Leave a comment

Windows useful likns

Here are some useful links:

Shutdown:
Shutdown.exe -s -t 00
Reboot:
Shutdown.exe -r -t 00
Sleep:
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Hibernate:
rundll32.exe PowrProf.dll,SetSuspendState
Lock:
Rundll32.exe User32.dll,LockWorkStation

Posted in Uncategorized | Leave a comment

Virtualizor NULL how2

 

chattr -i /usr/local/virtualizor/license.php
rm -rf /usr/local/virtualizor/license.php 
php_cwd=`/usr/bin/php << EOF
<?php
eval(gzinflate(base64_decode('DZe3DsTWEUV7/YglsGBOsC2BOWcuU2Mwx2XOX+9tiAUr7nsz957zz9//+Wdu5j/KMx3+rN92rIZ0L//M0q0ksP8VZT4V5Z//EpNR5iczFnsfBT3b19005tXVUY4yP92vm1M4BUY14q5JMtn7ESSQV4HgGKGgTVevLFNhQst0mL1WWGVKVBGZGhz8VIFG+wX19kVpBYXXeJ/4g0Uo6pzVBWI6MIgVikvC5mM5DRggTQzD76i9PeQjtoTdWs/Wbm9PVgMDnI/a36BDuLRkktYzWCnrG3CLOZb7GJL3YSSnezZCbOOWvHEvfuVZR2CjQJUifCgTsNkyiI0V8N68fcXsRe2Rm0mbd6QXzM68vseSow7ia7tv1ByiQbAO8URJiy6BuIEGfALmRnsfpbULcPvmfXk/x8Vujju5BYiIGrCkAB9FCBticOs6AeuvqueStqnqZ75AvjY/hYGkmc2yCVdLRWSWc1L6RVvbqthbAGur+WJtzAZF5cJsXwy9LaDSDAZ1TsvhQ0HFODtugXR0VJYKg8aORai7/eZq6W+oOaNBrgvNiGPDdh76sfUj0u5vGFDWc3GrZXAGMs9sj7iSKZhZwi/rx5+4A0SGk4vOcsNCEuXvzVszBNnoosBnMR1mTPNfxp8A+b0JpL06UkoJBYx3M8QQ65RtezVlW0s73dvqukTllDfJWgdjhaDL73BJvrO+JbuVhQ8B32zbogu44lKWjv0qg+zxfLV9Kokidb/pytWX6zMZZgqvtkWWSnwAIG7Xge/rJnt38vpqwWXnRqfWwDJfFbJKPt++YuFT+FioWSKWFCUeUwjK7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etk+fcU1bzVicfUuz4Ho9yEoXEbMkDcczglOOo7xZ2C6ShnmM3Tb1t2eOgPQhoVu4WcK1ThVgTGjmBPKKYwlFf8w19Jk3BraAb//IBp7t+sH8mmzSCIFhKfplQ4GyfrkJzGPjz6Lu/MONQNm0ptUGRRNp9SgPZ9bHooa3ASiM1T8/JGO+ssXFMOjn8UGS01d0wDP8xdI/HGZysw6C5RYXEuZQXsNcV2NqmWMyx2LzVG76s0Px9NzRfeecGaXON8yL0/8+PNKsPwbVZp3SE0usHX5kACtiP0XyOpqjwfw15YuIv5ezZW43dMW02Oes6jixZukGBtAbAFniFVoJ68llFaRxQUqsbjf1Yy2tXEKsyObUwx5xNkWZF1A95hhwmGA+dVBbqGrOgiWKCAzbS+QJm73bJVyqFraodJJesG4e5QjHxfWbkzD2oyz7tLHO0zPz/uuPW6OTlGceNLk6M7cl4cYuvI36OY8NKjNPZxa+Pikq0ZN2d6A1qmXacxkgB2gcLR98X1pJLN0Mnq3IYV71wMvgha2Y2VobL8Lo2PxNj8AIuMM6wLGNeBqYx3RgTzYbbUUKUrBehqiAWuY9IySjVqUB4/K2KeWSG8K96dlF7Ml+8h/QIRx+9AvIfrpvk+bhNX3dUrfy3/ECA7AL7XthwoIohf3Lhzp8lO3y4IMERRL/P6Qv0PeDHYhuFgtfsTFr7mwkWbURQmsQz/Nrj8sV4fcPTyMEj48Fh7ViZEvAJY0CNpRFIEghQE/0rXOE7yE//7rr7/++vcf//z9n3/+Dw==')));
?>
EOF`
echo $php_cwd > /usr/local/virtualizor/license.php
chattr +i /usr/local/virtualizor/license.php

 

Posted in Uncategorized | Leave a comment

A bit of cleanups

for i in $(ls /apps/ldap_backups); do k=$(ls /apps/ldap_backups/$i | wc -l)&& if [ $(expr $k) -gt 10 ]; then for l in $(ls -tr /apps/ldap_backups/$i |head -$(expr $k – 10));do echo removing “/apps/ldap_backups/$i/$l” && rm -rf /apps/ldap_backups/$i/$l; done ; fi ;done

Posted in Uncategorized | Tagged | Leave a comment

Changing root pass without command prompt

sudo echo -e ‘Dl5ch0tS.’ | (sudo passwd –stdin root)

Posted in wrk | Leave a comment

Secure uTorrent Server : Ubuntu uTurrent + Apache reverse Proxy + OpenSSL

Hi ladies and gents! recently I discovered that downloading torrents could be against the law šŸ™‚ So became of a need to install remote uTorrent Server + Apache reverse http proxy covered by SSL connection.

Install Ī¼Torrent in Ubuntu / Fedora

Ī¼Torrent is a freeware and a closed source BitTorrent Client. One of the most used lightweight BitTorrent Client, Now it is available for Linux asĀ Ī¼Torrent Server. You can download the tar file fromĀ utorrent.com. Before installing the uTorrent, you have to install the dependency library.

To Install Dependency Library

Ubuntu 14.04 Ā / 13.10 / 13.04 / 12.10 / 12.04 / 11.10Ā users run the below command to install the dependency library. Issue the password for the user when prompted.

sudo apt-get install libssl0.9.8:i386

Now Open a Terminal and use the following command to download.

wget http://download.utorrent.com/linux/utorrent-server-3.0-25053.tar.gz

After downloading the tar file, move to the directory where the downloaded file is located.

For example if the downloaded file is in Downloads directory then use the below command.

cd Downloads/

Now copy / move the tar file to opt directory, use the following command to copy the file to opt directory. Type the password for the user when prompted.Ā Then extract it.

sudo cp utorrent-server-3.0-25053.tar.gz /opt/

Now move to the opt directory to extract the tar file. Run the following commands one by one.

cd /opt/
sudo tar -xvf utorrent-server-3.0-25053.tar.gz

After extracting the tar file remove it.

sudo rm -rfĀ utorrent-server-3.0-25053.tar.gz

Change the permission of the extracted folder.

sudo chmod 777 -R utorrent-server-v3_0/

Create a symbolic link so that you can run the torrent server from terminal.

sudo ln -s /opt/utorrent-server-v3_0/utserver /usr/bin/utserver

Thatā€™s it.Ā Now you can start the utorrent server by using the following command in terminal.

utserver -settingspath /opt/utorrent-server-v3_0/ &

To access utorrent server

Open a browser and type the following line.

http://localhost:8080/gui/

Type theĀ User NameĀ asĀ adminĀ and leave theĀ passwordĀ field asĀ emptyĀ and clickĀ ok.Check the screen shot below.

Before you start downloading the torrents set the download location, by clicking on theĀ PreferencesĀ icon and selectDirectoriesĀ then click on the check box ā€œPut new downloads in:ā€ and specify the download location. For example if you like to have the Downloads directory as default then use the following line.

/home/user/Downloads/

*Note:Ā in the above line changeĀ userĀ to yourĀ user nameĀ in the system. Check the screen shot below.

That’s it for the torrent Server : Next Apache reverse proxy

Make mods enabled for apache2:

lrwxrwxrwx 1 root root 28 Feb 22 10:23 proxy.conf -> ../mods-available/proxy.conf
lrwxrwxrwx 1 root root 33 Feb 22 10:24 proxy_http.load -> ../mods-available/proxy_http.load
lrwxrwxrwx 1 root root 28 Feb 22 10:34 proxy.load -> ../mods-available/proxy.load
lrwxrwxrwx 1 root root 30 Feb 22 12:27 rewrite.load -> ../mods-available/rewrite.load
lrwxrwxrwx 1 root root 26 Feb 22 10:35 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 Feb 22 10:35 ssl.load -> ../mods-available/ssl.load

Create config :

cat /etc/apache2/vhosts/tor.conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName tor.lan.rr

RewriteEngine on
RewriteRule ^/gui(/?)(.*)$ /$2 [PT]

ProxyRequests off
ProxyPass / http://127.0.0.1:8080/gui/
ProxyPassReverse / http://127.0.0.1:8080/gui/
ErrorLog /var/log/apache2/utorrent-error.log
CustomLog /var/log/apache2/utorrent-access.log common

SSLEngine on
SSLCertificateFile /etc/ssl/tor.crt
SSLCertificateKeyFile /etc/ssl/tor.pem
BrowserMatch “MSIE [2-6]” \

nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
BrowserMatch “MSIE [17-9]” ssl-unclean-shutdown

</VirtualHost>

 

generate ssl keys and cert:

cd /etc/ssl/
openssl genrsa -des3 -out tor.key 1024
openssl req -new -key tor.pem -out tor.csr
openssl x509 -req -days 365 -in tor.csr -signkey tor.key -out tor.crt

service apache2 reload

Done.

 

 

 

Posted in Uncategorized | Leave a comment

Free memory Linux

  • To free pagecache:
    $ echo 1 > /proc/sys/vm/drop_caches 
  • To free dentries and inodes:
    $ echo 2 > /proc/sys/vm/drop_caches 
  • To free pagecache, dentries and inodes:
    $ echo 3 > /proc/sys/vm/drop_caches
Posted in Uncategorized | Leave a comment