ciphermethod.com

Ubuntu/Apache2/AWSTATS Browser/OS Data Missing

by on Feb.22, 2011, under Linux

Edit awstats.*.conf in /etc/awstats and verify LogFormat equals 1, and not 4.

# Examples for Apache combined logs (following two examples are equivalent):
# LogFormat = 1
# LogFormat = “%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot”
#
# Example for IIS:
# LogFormat = 2
#
LogFormat=1

To regenerate information, rm *domain* from /var/lib/awstats.  AWSTATS will then recreate all data in the access logs the next time the web forms are created.

Leave a Comment more...

20110214: yt2.sh

by on Feb.14, 2011, under Linux, Scripts


#!/bin/bash

# randomize website youtube videos created by Jamey Hopkins
# site then uses PHP to display the selected video on the site
# 20100427 jah - youtuberand.sh -> yt2.sh
#                conversion to 0 byte file use
#                cut out email
# 20100527 jah - create a .selected file for reference
# 20110214 jah - use /bin/bash since ubuntu uses dash for sh which is not compat. w/ FILE=($FILES)
#
# NOTE: use vid.1.yt2, vid.same.yt, etc, to specify the same video more than once (increase odds)
#       move *.yt to *.yt.off (or some other extension) to disable selection
#

echo

cd /root/Scripts/yt2.cm

# match specific or all random
# use -- to handle files that start with -
[ "$1" != "" ] && FILES=`ls -- *$1*.yt 2>/dev/null` || FILES=`ls -- *.yt 2>/dev/null`

echo "Matching Files:"
echo "$FILES"

# perform random magic
FILE=($FILES)
NFILES=${#FILE[*]} #count
VID=`echo ${FILE[$((RANDOM%NFILES))]}`

echo
echo "Picked -> $VID"

# send random youtube string to file
echo "$VID" | cut -f1 -d. > /var/www/ciphermethod.com/random.youtube
rm -- *selected >/dev/null 2>&1
cp -- $VID $VID.selected

echo
Leave a Comment more...

Which application is using a Linux network port?

by on Feb.01, 2011, under Linux, Networking

Use: netstat -tlnp | grep port

Example using netstat:
[root@trioxin2 jhopkins]# netstat -tlnp | grep 80
tcp 0 0 :::80 :::* LISTEN 4246/httpd

The above example reveals that the httpd process with a PID of 4246 is running on port 80.

To verify, you can run the ps command and grep for the application name or PID:
[root@trioxin2 jhopkins]# ps -ef | grep 4246
root 4246 1 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4249 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4250 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4251 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4252 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4253 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4254 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4255 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd
apache 4256 4246 0 13:35 ? 00:00:00 /usr/sbin/httpd

Example using fuser:
# fuser 80/tcp
80/tcp: 3130 7057 11956 11957 11958 26771 26801 30170 32433 32434 32766

# ps -ef | grep 3130
root 3130 1 0 Mar02 ? 00:01:19 /usr/sbin/apache2 -k start
www-data 7057 3130 0 Apr01 ? 00:01:18 /usr/sbin/apache2 -k start
www-data 11956 3130 0 Apr04 ? 00:00:23 /usr/sbin/apache2 -k start
www-data 11957 3130 0 Apr04 ? 00:00:38 /usr/sbin/apache2 -k start
www-data 11958 3130 0 Apr04 ? 00:00:42 /usr/sbin/apache2 -k start
www-data 26771 3130 0 Apr03 ? 00:00:54 /usr/sbin/apache2 -k start
www-data 26801 3130 0 Apr03 ? 00:00:50 /usr/sbin/apache2 -k start

Leave a Comment more...

Fedora 14 and Broadcom 4312 Wireless Install on HP Mini 110

by on Jan.03, 2011, under Fedora, Networking, Wireless

ERROR: Firmware file “b43/ucode5.fw” not found or load failed.

Ignore drivers in /lib/firmware/b43-open and perform the following:

1. yum install b43-fwcutter wget
2. wget downloads.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
3. tar xjf broadcom-wl-4.150.10.5.tar.bz2
4. cd broadcom-wl-4.150.10.5/driver
5. b43-fwcutter -w /lib/firmware/ wl_apsta_mimo.o
to install all firmware into /lib/firmware/b43
6. reboot

HP Mini 110 Laptop should boot and come up with wireless functioning.

Were these instructions helpful? Please click the Google links below.

Leave a Comment more...

How To Change MAC Address

by on Nov.11, 2010, under Linux, Networking

f4:43:2f:a3:93:95 = new MAC

# ifconfig eth0 down
# ifconfig eth0 hw ether f4:43:2f:a3:93:95
# ifconfig eth0 up

Leave a Comment more...


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

But Wait, There's More!

A few highly recommended friends...