Observium client setup notes

observium server on ubuntu http://www.observium.org/docs/debian_ubuntu/ observium agent wget http://x.x.x.x/apache wget http://x.x.x.x/mysql wget http://x.x.x.x/nginx ubuntu #setup agent apt-get -y install xinetd wget cd /etc/xinetd.d/ wget http://x.x.x.x/observium_agent_xinetd cd /usr/bin/ wget http://x.x.x.x/observium_agent chmod 775 /usr/bin/observium_agent mkdir /usr/lib/observium_agent mkdir /usr/lib/observium_agent/local service xinetd restart #monitor with mysql agent apt-get -y install php5-cli php5-mysql cd /usr/lib/observium_agent/local wget http://x.x.x.x/mysql chmod 775 mysql […]

compiling cacti-spine 0.8.8d with mariadb on centos6

get the other libraries snmp, ssl, etc yum install MariaDB-devel ln -s /usr/lib64/mysql/libmysqlclient_r.so.16.0.0 libmysqlclient_r.so ln -s /usr/lib64/mysql/libmysqlclient.so.16.0.0 libmysqlclient.so then compile if you get this error during make common.h:143:18: error: mib.h: No such file or directory then cp /usr/include/net-snmp/library/mib.h .

Change username in Ubuntu

To manage every aspect of the user database, you use the usermod tool. To change username (it is probably best to do this without being logged in): usermod -l newUsername oldUsername This however, doesn’t rename the home folder. To change home-folder, use usermod -d /home/newHomeDir -m newUsername after you changed the username.


For Chrome v40: Open chrome://flags Look for “Minimum SSL/TLS version supported.” Choose SSLv3 Click on “Relaunch now” button Open your https page again You will be redirected to a “Your connection is not private” page. If you do not worry about this security issue click on the “Advanced” link. Finally click on “Proceed to (unsafe)”. […]

sed tips

sed -i ‘s/fengo/dressholic/g’ *  sed -i ‘s/Fengo/Dressholic/g’ *  search folders for file type recurisvely and replace text in file find . -type f -exec sed -i.bak “s/fengo/dressholic/g” {} \;  find . -type f -exec sed -i.bak “s/Fengo/Dressholic/g” {} \;  delete files in folders with extension find . -name “*.bak*” -type f -delete

In Unix, how do I find a user’s UID or GID?

In Unix, how do I find a user’s UID or GID? To find a user’s UID or GID in Unix, use the id command. To find a specific user’s UID, at the Unix prompt, enter: id -u username Replace username with the appropriate user’s username. To find a user’s GID, at the Unix prompt, enter: […]

Just installed privacy badger

DuckDuckGo Donates $100,000 Among Four FOSS Projects https://securedrop.org/ https://www.eff.org/privacybadger https://tails.boum.org/ https://gpgtools.org/gpgsuite.html  

invalid app Id: Must be a number or numeric string representing the application id. FB.getLoginStatus() called before calling FB.init().

this was my original code (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.async = true; js.src = “//connect.facebook.net/{/literal}{$st_lb_locale}{literal}/all.js#xfbml=1; fjs.parentNode.insertBefore(js, fjs); }(document, ‘script’, ‘facebook-jssdk’)); I tried to add FB.init above it with app id but I get an error that FB.init was already called. FB.init […]

owasp stuff

https://code.google.com/p/webgoat/ http://chousensha.github.io/blog/2014/08/08/pentest-lab-damn-vulnerable-web-application/

infinite loop dd benchmark stress test script

X=1 while : do echo $X echo “write sync” time sh -c “dd if=/dev/zero of=/mnt/sda/ddfile bs=8k count=4000000 && sync” echo “write flush” time sh -c “dd if=/dev/zero of=/mnt/sda/ddfile bs=8k count=2000000” echo “read” time sh -c “dd if=/mnt/sda/ddfile of=/dev/null bs=8k” ((X+=1)) done

Change file and folder permissions

find . -type f -exec chmod 644 {} ; find . -type d -exec chmod 755 {} ; below works for ubuntu To change permission of only files under a specified directory. [email protected]:/home/user$ sudo find /path/to/someDirectory -type f -print0 | xargs -0 sudo chmod 644 [email protected]:/home/user$ ls -l total 3 -rw-r–r–  1 user user 0 Nov 19 20:13 file1 drwxrwxrwx  2 user user 4096 Nov […]

passwd: Authentication token manipulation error

Centos [[email protected] ~]# passwd Changing password for user root. New UNIX password: Retype new UNIX password: passwd: Authentication token manipulation error solved [[email protected] ~]# /usr/sbin/useradd aa useradd: unable to open password file [[email protected] ~]# chattr -i /etc/passwd [[email protected] ~]# /usr/sbin/useradd aa useradd: cannot open shadow password file [[email protected] ~]# lsattr /etc/passwd ————– /etc/passwd [[email protected] ~]# […]

Chrome Remote Desktop is here

This is gonna put some companies out of business support IOS and android too! No need for splashtop https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en

Latest cpanel 11.48 broke cphulkd

The system failed to add an IP address to cphulkd hosts because the “cphulkd.ip_lists” table may be corrupted and returned the following error: DBD::mysql::db do failed: Table ‘cphulkd.ip_lists’ doesn’t exist. run [email protected] [/var/cpanel]# /usr/local/cpanel/bin/hulkdsetup hulkdsetup: synchronizing database schema ALTER TABLE brutes CHANGE COLUMN BRUTETIME BRUTETIME timestamp NOT NULL DEFAULT ‘0000-00-00 00:00:00’ # was datetime DEFAULT […]

Radius login with Ubuntu

sudo apt-get install libpam-radius-auth edit $ sudo vim /etc/pam_radius_auth.conf find other-server    other-secret       3 change to 192.168.x.x secretkey 3 Edit your /etc/pam.d/sshd file and add the line: auth       sufficient  pam_radius_auth.so Just above: # Standard Un*x authentication. @include common-auth had to update firewall config and configure radius to accept auths from this IP using this to upload […]

nginx error connect to php5-fpm.sock failed (13: Permission denied)

PHP fixed a security bug where o had rw permission to the socket file. Open /etc/php5/fpm/pool.d/www.conf Uncomment all permission lines, like: listen.owner = www-data listen.group = www-data listen.mode = 0660 Restart fpm – sudo service php5-fpm restart Note: if your webserver runs as as user other than www-data, you will need to update the www.conf […]

cpanel – change pure-ftpd port

Pure-FTP 1) Edit /etc/pure-ftpd.conf and look for the following line: Bind Where is a publically routable IP.  The default example,, will cause the socket to bind locally but then this connection won’t serve externally. is the new port you wish to put the service on. 2) If necessary, add the new FTP port to […]

How to Setup Apache2 (HTTPD) with FastCGI and PHP on CentOS/RHEL 6/5

  yum install mod_fastcgi Loaded plugins: fastestmirror, replace Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.psychz.net * epel: mirror.prgmr.com * extras: mirrors.xmission.com * rpmforge: mirror.webnx.com * updates: mirrors.easynews.com * webtatic: us-east.repo.webtatic.com Resolving Dependencies –> Running transaction check —> Package mod_fastcgi.x86_64 0:2.4.6-2.el5.rf will be installed –> Finished Dependency Resolution Dependencies Resolved […]

mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5

[Fri Jan 30 10:47:40 2015] [error] mod_hostinglimits:Error on LVE enter: LVE(508) HANDLER(fcgid-script) HOSTNAME(lovetheclassic.com) URL(/index.php) TID(714206) errno (7) Read more: http://e.cloudlinux.com/MHL-E2BIG [Fri Jan 30 10:48:19 2015] [warn] [client] mod_fcgid: can’t apply process slot for /usr/local/cpanel/cgi-sys/php5 Also, make sure you monitor apache error logs. If you see “can’t apply process slot for error” — it means […]

Updating servers cuz of glibc vulnerability

Ghost is a vulnerability in glibc that attackers can use against only a handful of applications right now to remotely run executable code and gain control of a Linux server. The vulnerability is a heap-based buffer overflow and affects all Linux systems, according to experts, and has been present in the glibc code since 2000. […]

setup memcached for cloudlinux

#yum install memcached #yum install libmemcached   Even though memcached is happily running on the server, it’s not accessible from PHP without the PECL extension. Fortunately this is a very easy process, just use the pecl command. # pecl install memcache https://linuxnlenux.wordpress.com/2013/07/28/memcache-installation-in-cpanel-server-via-yum/  

Can’t resolve *.local domain on VPN Mac Yosemite

After running sudo discoveryutil mdnsactivedirectory yes in the terminal we’re able to resolve .local FQDNs again. This gets it to use regular (unicast) DNS for .local domains rather than just using multicast DNS (mDNS, aka Bonjour) to look-up .local addresses. Place the following file in /Library/LaunchDaemons: https://gist.github.com/CodingMinds/509bd12a7c7e22f0cfdd https://discussions.apple.com/thread/6611817?start=15&tstart=0

network speedtest bench.sh

bench.sh #!/bin/bash cname=$( awk -F: ‘/model name/ {name=$2} END {print name}’ /proc/cpuinfo ) cores=$( awk -F: ‘/model name/ {core++} END {print core}’ /proc/cpuinfo ) freq=$( awk -F: ‘ /cpu MHz/ {freq=$2} END {print freq}’ /proc/cpuinfo ) tram=$( free -m | awk ‘NR==2 {print $2}’ ) swap=$( free -m | awk ‘NR==4 {print $2}’ ) up=$(uptime|awk […]

logstash notes

600  /opt/logstash/bin/logstash -f /etc/logstash/conf.d -l /var/log/logstash/logstash.log     http://blog.stevenmeyer.co.uk/2014/06/add-configuration-test-to-logstash-service-configtest.html

Apache tuning

ps aux | awk ‘{sum1 +=$4}; END {print sum1}’ /usr/local/bin/mysqltuner.pl ps -ylC httpd | awk ‘{x += $8;y += 1} END {print “Apache Memory Usage (MB): “x/1024; print “Average Proccess Size (MB): “x/((y-1)*1024)}’ http://diywpblog.com/how-to-work-out-max-clients-for-your-vps-or-dedicated-server-running-apache/comment-page-1/#comment-2393

How to Start vSAN Observer

Remote desktop to vcenter server Open command prompt and run C:\Program Files\VMware\Infrastructure\VirtualCenter Server\support\rvc\rvc.bat Enter password Enter in prompt -> cd localhost/<Datacenter> cd computers/<Cluster name> vsan.observer –run-webserver –force –no-https ./ Note: Type ‘ls’ to see listing and you can also use tab for autocomplete datacenter and cluster names Open in browser http://localhost:8010/   http://blogs.vmware.com/vsphere/files/2014/08/Monitoring-with-VSAN-Observer-v1.2.pdf