10 March 2019

Freebsd wifi setup on raspberry pi

Get TP-Link USB wifi module to load.
 Edit /boot/loader.conf
 Add

if_rtwn_load="YES"
legal.realtek.license_ack=1
if_rtwn_usb_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"



Then reboot.

Run ifconfig -a to check if wlan0 is up.

Manual test
ifconfig wlan create wlandev rtwn0 inet 192.168.0.20 netmask 0xffffff00

 wlan0 is now up.

12 September 2014

Apache config file syntax check.

To check the syntax of a apache config file.


httpd -S -f [config file.conf]

13 August 2014

Copy files between 2 remote servers using cpio.

ssh rhost1 "find dir | cpio -ocB" | ssh rhost2 "cd rdir2;cpio -ivB "

10 June 2011

Watch command

Use the watch command to highlight changes in vmstat & iostat

watch -d --interval=1 iostat -xc

watch --color -d --interval=1 vmstat

18 August 2009

cpio examples

To create an archive
find . | cpio -ocvB > x.cpio

Read an archive:
cpio -itcvB -I x.cpio

Read a file from archive:
cpio -itcvB -I x.cpio ".ssh/known_hosts"

Restore the file (remove the t option).
cpio -icvB -I x.cpio ".ssh/known_hosts"

List hardware

dmidecode

07 January 2009

wget tips

Using wget to download file with a site that requires authentication.

wget ftp://user:password@ftp.site.com/dir/file.name

22 August 2008

Grub. Quick fix after XP re-install

Boot off rescue dvd/cd.
start grub.
>find /boot/grub/stage1
(hd0,2)
>root (hd0,2)
>setup (hd0)
>exit

reboot.

21 May 2008

Create large files for testing.

This command will create a 100Mb file.

dd if=/dev/random of=myfile.dat bs=$(( 1024 * 1024 )) count=100

This can take a long time, so try this

dd if=/dev/zero of=myfile.dat bs=$(( 1024 * 1024 )) count=100

See Unix Administratosphere for more detail.

31 January 2008

Redhat: Change server name

Edit name in /etc/sysconfig/network

06 July 2007

Visudo

Using sudo with groups

1.

# Cmnd alias specification
Cmnd_Alias USER_SU = /usr/bin/su - ngu


2.

At the bottom of the sudoers file.
%ngp ALL = USER_SU



This will allow anyone belonging to group ngp to sudo to user ngu.

12 June 2007

Easy way to set a user password

echo "password" | passwd --stdin username