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  

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); = id; js.async = true; js.src = “//{/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

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

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 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 = 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: * epel: * extras: * rpmforge: * updates: * webtatic: 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( URL(/index.php) TID(714206) errno (7) Read more: [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  

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:

network speedtest #!/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

Apache tuning

ps aux | awk ‘{sum1 +=$4}; END {print sum1}’ /usr/local/bin/ 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)}’

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> –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/

Headache – VMware Inventory Services – Error Starting Services

look for ds.log in “c:\programdata\vmware\infrastructure\inventory service\logs” [2014-11-07 04:01:00,622 WrapperListener_start_runner FATAL com.vmware.vim.dataservices.WrapperListenerImpl] Error starting service: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘instanceUUID’ defined in class path resource [server/config/server-config.xml]: Cannot resolve reference to bean ‘store’ while setting bean property ‘targetObject’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘storeFactory’ defined in class path resource [server/config/query-server-config.xml]: Invocation […]

Speedtest has a cli –

When you want to run speedtest from a linux server you can try cli version

Remove /home with LVM and add to /

  Make sure you have no data in /home. If you do then move it or copy it somewhere else. You will lose all data in the Logical Volume. umount /home lvremove /dev/mapper/vg_ubuntu_home lvdisplay lvextend -L+#G /dev/mapper/vg_ubuntu_root resize2fs /dev/mapper/vg_ubuntu_root df -h