Wednesday, June 18, 2014

Windows XP Dying... No more updates!!!!

Make your Windows XP = POS ( Point of Sale )
So you can update...

Notepad > Save as .reg > Double click
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\WPA\PosReady]
"Installed"=dword:00000001


Works???

Debian - MySQL - Why i cannot install?

GRRRRRRRRRrrrrrrrrr

Fired up a debian template.
Could not install a stupid mysql.
2014 already... WHY LIKE THAT?

apt-get install mysql-server
XXXXXXX

mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
InnoDB: Using Linux native AIO
InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: Completed initialization of buffer pool
InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

How u fix?
nano /etc/mysql/my.cnf
Add this -> innodb_use_native_aio=0 * This should be under the [mysqld] tag

Change your root password ( which is empty because some how something screw up...)
mysqladmin -u root password NEWPASSWORD

Then suei suei if you get an error as such:
'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

cat /etc/mysql/debian.cnf
Note the password in the client section.
[client]
host     = localhost
user     = debian-sys-maint
password = SOMERANDOMPASSWORDHERE
socket   = /var/run/mysqld/mysqld.sock

mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'SOMERANDOMPASSWORDHERE';

/etc/init.d/mysql restart
*pray

AB - Apache Benchmark?

ab -n 5000 -c 30 "somesite.com"

Wrong time again Mr Windows 2008?

Grrrrr....
One of my VM date time running windows 2008 is screwed again.
Used this to fix it once and for all...

Stop the W32Time service: 
net stop w32time

Configure the external time sources
w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org"

Make your PDC a reliable time source for the clients. 
w32tm /config /reliable:yes

Start the w32time service: 
net start w32time

The windows time service should begin synchronizing the time. 
You can check the external NTP servers in the time configuration by typing: 
w32tm /query /configuration

Check the Event Viewer for any errors.

*Pray

Dealing with AWSTATS.

My friend passed me an apache log file and i've attempted to parse it to AWSTATS for more "report style" human readable format...

* history > should_be_the_steps_to_follow

Wget the file / Unzip the file
wget "http://prdownloads.sourceforge.net/awstats/awstats-7.3.zip"
unzip awstats-7.3.zip

Make a directory and move awstats there.
mkdir /usr/local/awstats/
mv * /usr/local/awstats/

cd tools/
perl awstats_configure.pl
*Follow instructions to add stuff to apache/default site.

mkdir /var/lib/awstats/ ( for temp file creation i guess )

============= Jobs Done ============= 

Creating a config file for awstats.
nano /etc/awstats/awstats.demo.conf ( Replace demo with a name for easy identification )
- Change your logfile path to point to the apache access log

Execute the awstats to read your log and do it's stuff.
perl /usr/local/awstats/wwwroot/cgi-bin/awstats.pl -config=demo -update

To build static pages ( reports ) for your users.
perl /usr/local/awstats/tools/awstats_buildstaticpages.pl -config=demo -update -dir=/some/directory/here/