Thursday, December 13, 2012

OSX 10.8.x - Permission denied writing to home directory.

I was getting the following error after a fresh install of OSX 10.8.x:

jemurray@dsg:~ $ touch test
touch: test: Permission denied

Looking at the basic permission I see:

jemurray@dsg:/Users $ ls -al
total 0
drwxr-xr-x   5 root      admin   170 Dec 11 16:15 .
drwxr-xr-x  30 root      wheel  1088 Dec 13 16:15 ..
-rw-r--r--   1 root      wheel     0 Jun 20 15:00 .localized
drwxrwxrwt   3 root      wheel   102 Dec 11 16:08 Shared
drwxr-xr-x@ 24 jemurray  staff   816 Dec 13 09:01 jemurray 

Looking at the extend permissions on the home directory I see:

jemurray@dsg:~ $ ls -lea
total 112
drwxr-x---@  24 jemurray  staff    816 Dec 13 09:01 .
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown

This is incorrect, it should be:

jemurray@dsg:~ $ ls -ale
total 112
drwxr-x---@  24 jemurray  staff    816 Dec 13 16:35 .
 0: group:everyone deny delete


The problem was fixed by running this command:

cd ~
sudo chmod =a# 0 "group:everyone deny delete" .

It works:

jemurray@dsg:~ $ touch test
jemurray@dsg:~ $ 


Tuesday, October 30, 2012

Using Debian package tools to list files in a package

To find a file in a Debian package here is a quick reference.

Using the dpkg command:

dpkg -l  =  List all the packages on the system.

dpkg -L {package}  =  List all the files in a package.


Example:
jemurray@unixhosts:~$ dpkg -l | grep mailman
ii  mailman                           1:2.1.13-1ubuntu0.2               Powerful, web-based mailing list manager
jemurray@unixhosts:~$ dpkg -L mailman | grep sbin
/usr/sbin
/usr/sbin/list_lists
/usr/sbin/find_member
/usr/sbin/config_list
/usr/sbin/mmsitepass
/usr/sbin/newlist
/usr/sbin/rmlist
/usr/sbin/add_members
/usr/sbin/list_members
/usr/sbin/remove_members
/usr/sbin/clone_member
/usr/sbin/sync_members
/usr/sbin/check_db
/usr/sbin/check_perms
/usr/sbin/list_admins
/usr/sbin/withlist
/usr/sbin/mmarch

Saturday, October 20, 2012

OSX - Can't login after TM restore - 'Update Needed'

After replacing my stock hard drive with a new Samsung 830 and restoring backups from Time Machine, I could no longer log into the laptop.  After the system was rebooted, the only thing on the login screen was image that says "Update Needed":

Update Needed

You could not click on the login box, there was nothing that could be done to login.


The problem had to do with the type of partition I created before restoring the backup:

Mac OS Extended (Journaled, Encrypted)
You can not recover the Time Machine image on an encrypted partition.


After the drive was repartition with out encryption, time machine was used to restore the drive.   Everything worked as expected.


Side Note:

According to Blackmagic Disk Speed Test the speed from the stock drive was around 70 MB/s.   After installing the SSD the speed is quite a bit better:





Wednesday, October 17, 2012

Resize Linux ext4 partition using Parted Magic Live CD

I accidentally created a partition too small.

The system was the self contained version of cPanel running on top of CentOS 5.x, under the free version of vmware,

Luckily the file system I needed to expand was at the end of the disk (/dev/sda5):


root@cpanel-dev [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             9.2G  4.3G  4.5G  49% /


Using vmware I expanded the disk by simply adding space to the existing disk, after which the disk now has 26gb of space:

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 26.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  313MB   313MB   primary   ext3         boot 
 2      313MB   2459MB  2147MB  primary   ext3              
 3      2459MB  6662MB  4203MB  primary   linux-swap        
 4      6662MB  17.2GB  10.5GB  extended                    
 5      6663MB  17.2GB  10.5GB  logical   ext3 



In order to resize the disk, I downloaded a copy of the parted magic live cd.

Reboot the system and boot off the parted live cd.

The first thing that needed to be done was resize the extended partition 4 to the end of the disk.   After this was completed, I resized partition 5 to the end of the disk.

Apply changes.

Reboot.

The disk and filesystem was automatically resized:


root@cpanel-dev [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              18G  4.3G   13G  26% /

Monday, October 15, 2012

connectbot + hackerskeyboard

If you ever need to ssh from your Android device, you know how hard it can be to use the stock Android keyboard.   Simple things like the escape key, up arrow, tab completion, and various other keys like numbers and symbols make using a terminal much easier.

The following apps:


make remote ssh sessions from an Android device a pleasing experience.   vi, screen, bash history, etc all flow much easier with a "full sized" keyboard with all the important keys.   

Hacker's Keyboard with ConnectBot on Samsung Galaxy Nexus in landscape mode.

This past week I was staying at Sheraton Suites, which charges a ridiculous $9.95 per 24/hours for Internet access.  I was able to ssh into one of my servers, edit my named.conf and restart the service.    Besides the small screen, it was not difficult to do.   The keyboard is very comfortable.

Cisco fails to relay DHCP requests

After a multiple hour outage of DHCP services to one of our departments we finally determined the issue to be a DHCP relay (helper) problem (bug) after a router/switch upgrade.

In this example our layer3 SVI was anchored on a Cisco 3750 running:

c3750-advipservicesk9-mz.122-25.SEE1.

To address some memory issues in this release we upgraded to:

c3750-ipservicesk9-mz.122-55.SE6.bin

After this change anyone with a layer 3 interface behind this device could no longer get DHCP services.   We spanned the uplink from this switch to the DHCP server and saw the discover and offer packets.   When we spanned links that faced our clients we would see the discover packets only.   

This narrowed the problem down to something local to the switch.   

We are always hesitant to run "debug" anything on Cisco device, however, once we put the switch into debug mode, the problem was obvious:

DHCP server packet debugging is on.
switch#term mon

02:06:19: DHCPD: option 47 is malformed (option length 0).
02:06:19: DHCPD: invalid DHCP options - unable to parse
02:06:20: DHCPD: option 47 is malformed (option length 0).
02:06:20: DHCPD: invalid DHCP options - unable to parse
02:06:20: DHCPD: option 47 is malformed (option length 0).
02:06:20: DHCPD: invalid DHCP options - unable to parse
02:06:20: DHCPD: option 47 is malformed (option length 0).
02:06:20: DHCPD: invalid DHCP options - unable to parse


In our ISC dhcpd.conf file we had this following option configured in one of our scopes:


option netbios-scope ""

I am not sure why this option was there or who configured, but either way it was, and probably has been for a very long time.   This subnet never gets changed.

We removed the option, reloaded the server, and everything started working as expected.   

Sunday, October 14, 2012

cut-and-paste with screen.

I have been using GNU/Screen for a very long time, never once have I taken the time to figure out how to cut and paste using the native interface.  Here are the basics.





Copy
Paste


Friday, September 7, 2012

Apple AirDrop Spectrum

While trying to figure how much of an impact AirDrop would have on our university wireless network we ran spectrum analyzer.

 AirDrop created a 40 Mhz wide channel using 157 and 161.

 Here are the results:

























We still need to figure out how Apple determines what channels it will use?

Followers

Contributors