Thursday, November 21, 2013

Freenas Format Error: Operation Not Permitted

Freenas Format Error

If your trying to erase a drive in freenas and you get an error "Can't Erase Drive /dev/: Operation not permitted it is happening because of GEOM's protection of the MBR of the disk drive.

To solve this turn off the sysctl variable from the console.

sysctl kern.geom.debugflags=0x10


Wednesday, November 13, 2013

Connecting A Mac To A Windows Share

Connecting A Mac to a Windows Share



With the exception of mobile devices we still live in a "Windows World" and with the latest version of OS X comes an update on how to connect to a windows share using SMB2 instead of SMB.

On Mac OS X (Pre Mavericks or 10.9) we connected to a windows share using smb.

From the Finder press the "Command" + "K" keys or go to the "Go" menu and select Connect to Server.  In the server address field put in either smb for pre 10.9 or cifs for 10.9

On a workgroup it looks something like this:

smb://thecomputer/sharedfolder

On an active directory the samba setup it looks more like this

smb://domain.ext/dfs/sharedfolder on a domain using a DFS Share

Now on OS X Mavericks we use cifs to connect to the windows shares.

cifs://thecomputer/sharedfolder on a workgroup and 

cifs://theremotecomputer/sharedfolder$ on a domain using a DFS Share

If you are not logged into the domain or if the share doesn't have anonymous access it will prompt you for a username and password.

Friday, November 08, 2013

How to ssh into a Linux/Unix System without a password

Login to a Linux/Unix System without a password 



Setting up SSH/RSH Keys for Remote Administration Under Linux/Unix can be one of the most time saving things you can do.  I've set this up because I am managing a dozen Linux based kiosks based Lubuntu Linux and Mozilla FireFox on that need to remotely shutdown and startup.

For managing the kiosks I am using Ubuntu 12.04 LTS, on a VLAN network.  This server also remotely shuts down some Windows based stations and is used for Imaging using the FOG project.  I need to update the RSH Public and Private Key because I have replaced the server.

Setting up RSH Public and Private keys are trivial but this allows me to control the systems without having to enter a password every time I want to do something to the computer (besides something that requires root privileges).

The first thing I do on the computer I want to control the other computers with is generate a public and private key.  I've done this in a .ssh directory using the Terminal

$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''

This should create two files, $HOME/.ssh/id_dsa (private key) and $HOME/.ssh/id_dsa.pub (public key).

In my case I'm using a script called dafturn-ofris which is kind of a steady state script for linux which prevents users from making changes to the system and rebooting restores the system to the state it was frozen in.  So I unfreeze the client system (the system I want to control remotely) and copy the public key from the "Server" to the client; I used SCP to accomplish this.

On the computer you created the key on open the Terminal move to the directory you generated the public key.  In my case it is the .ssh folder in the $HOME directory of the user I'm logged in as.

$ scp id_dsa.pub username@remotehost:directory/to/save/it/in/

Enter in your password and this will complete the file copy.

Then login the remote client move into the directory where you saved the public key and run the following commands.

$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2

Depending on the version of OpenSSH your using the following commands may also be required.

$ cat id_dsa.pub >> $HOME/.ssh/authorized_keys
$ chmod 0600 $HOME/.ssh/authorized_keys

An alternative is to create a link from authorized_keys2 to authorized_keys; your choice.

$ cd $HOME/.ssh >> ln -s authorized_keys2 authorized_keys

Now you should be able to remote into the client computers you want to control from the server computer without being prompted for a password; with the exception of root access.  I use this for running rsh command that remotely shuts down client stations when its closing time.

Source Credit: http://csua.berkeley.edu/~ranga/notes/ssh_nopass.html

How to fix CURL call imporitng an RSS feed on a site blocking CURL calls

There is a 3rd party service provider that my organization uses called bibliocommons.  They have these nice book carousels.  However the car...