Saturday, August 13, 2011

As-Is, Not Everything I Do Works Out As I Had Hoped

So, putting my file server on a VM did not have the outcome I was hoping.

But, I did do a few cool things that may save someone else a few minutes and some hair pulling. So, some of the steps I took access to the raw disks from a VM are provided below as-is. So, my notes are presented unformatted as such below.


My old fileserver with all my most treasured files was highly under utilized. So the plan was to move it to a virtual machine host.
This begged giving a OpenIndiana VM access to raw disks for zpooling (and maybe raid-z when I get better hardware for the house).

I backed up my files and started with empty platters on my spindles.


Step 1 Attach two physical disks to the host machine which become the storage mediums of the upcoming zpool.
no partitions - don't make any or get rid any preexisting

My Debian Host OS recognized the new drives as /dev/sdb & /dev/sdc and we will not mount and/or prevent mounting them.



Everything else will be easiest to accomplish as the root user.

su



brad will be the user VirtualBox will be running under
change the ownership and mode of the device nodes to allow ufettered access by the user running VirtualBox

chown brad /dev/sdb
chown brad /dev/sdc

chmod 775 /dev/sdb
chmod 775 /dev/sdc



Add the user of the VirtualBox process to the disk group

sudo usermod -a -G disk brad



create the .vmdk files

VBoxManage internalcommands createrawvmdk -filename /home/brad/.VirtualBox/a1.vmdk -rawdisk /dev/sdb -relative
VBoxManage internalcommands createrawvmdk -filename /home/brad/.VirtualBox/a2.vmdk -rawdisk /dev/sdc -relative



change the ownership and mode of the pointer files to allow ufettered access by the user running VirtualBox

chown brad /home/brad/.VirtualBox/a1.vmdk
chown brad /home/brad/.VirtualBox/a2.vmdk

chmod 775 /home/brad/.VirtualBox/a1.vmdk
chmod 775 /home/brad/.VirtualBox/a2.vmdk



log out
log in



add the .vmdk files to your virtual machine via the GUI.



Time to boot the VM.

Yeah, that's it. Fire her up. My username within the OpenIndiana VM will also be brad.



Do whatever administrative things you might do with a new machine.

Set the network connection to a fixed IP. Give good users privileges, take privileges away from bad users-- or the other way around if you desire a little more excitement in your life.



Setting up your first zpool is easiest as root. I am choosing to mount my zpool in a non-standard spot with the -m option.

su
mkdir /export/home/zfs/
zpool create -m /export/home/zfs/ memory mirror /dev/dsk/c1t2d0p0 /dev/dsk/c1t3d0p0



Create filesystems on your zpool that is much like a software RAID 1 volume. Except ZFS cares about the integrity of your data and the effects bitrot.

zfs create memory/photos
zfs create memory/iso
zfs create memory/music
zfs create memory/videos
zfs create memory/misc
zfs create memory/work
zfs create memory/holding

groupadd securftp

usermod -G securftp brad

chgrp securftp /var/zfs/holding

chmod 774 /var/zfs/holding

"My Printer Doesn't Work"

Normally "My Printer Doesn't Work" isn't enough information to give a concise clear answer.


Challenge Accepted


I am going to make a few assumptions...

MS Vista OS, MS Office 2007, and a consumer grade USB Inkjet/Laser printer.

Basics before we do anything.

	Hardware level 

		Power cord plugged in at the printer and the wall?
			Give both ends a gentle tug to make sure they are seated tightly.
		Is the USB cable plugged in at the printer and the computer case?
			Gentle tug at both ends again.

First we are going to make sure that the OS recognizes there is a printer attached.

	Click the 'Start Button' (It is the round button in the lower left.)
	RIGHT CLICK 'Computer' in the second column.
	A context menu will pop up, click 'Properties'.
	A Management Console will pop up.
	Click 'Device Manager' in the left hand column.
		You may neet to allow the action to continue.

	You should see a little directory tree of every hardware device your computer has.
		Many will be gobbldygook devices that you've never heard of.
			PCI Bus... WTF?
		Some, like the keyboard, will be plainly visible and familiar.
		Look for either 'Printers' or 'Universal Serial Bus controllers'
			Is your printer in either of those?

			NO, you need to reinstall the printer with the manufacturer's disk
			 or with a downloaded setup program from the manufacturer's website.

			YES, close all the windows and continue.

Next, since the computer knows your printer exists; we need to make sure it knows to use it.

Let's check to make sure the Operating System has your printer set as the 'default' printer.

	Click the 'Start Button' (It is the round button in the lower left.)
	Click 'Control Panel' in the right hand column.
	A management console type window will pop up.
		You may neet to authorize the action.
	Click 'Hardware and Sound'
	Click 'Devices and Printers' if 'Printers' by itself isn't available.
	Look for your printer, it should have a checkmark.
		If not RIGHT CLICK your printer and cick 'Set as default printer'.
		If it does we'll look in MS Office.
	Close all the windows.

	Open MS Office (Word or Excel)
	Click the 'Windows' type image in the upper left corner.  It is actually a menu icon.
		'Print...' is in there.
			If you use the 'Print...' menu item it will give you printing options.

As a last resort, try 'Windows Update'.
	Click the 'Start Button'.
	Click 'Programs'.
		You should see 'Windows Update'.
		Click it and follow the instructions
		Restart your Computer.
			Rinse and repeat until 'Windows Update' reports no more updates for your computer.

If these instructions fail, you can try ###-953-9738 which is my home number.
But, I will expect a small favor in exchange.
	(Nothing difficult, nothing creepy.  If I were in a movie, I would wear a white hat.)

I was able to learn that the printer was not recognized until the drivers were loaded. Once the drivers were loaded she could print. ...Challenge Beaten

Using nLight to Create Your Own Custom Windows Installs

Background


I have the specific opportunity to build a system specific restore disk on a regular basis. For people I will never see more than once, this issue is nonpoint. But, for people such as me, my close friends and family that may require more than one system restore, as well as the piles of identical machines that have rolled through my workspace; a custom disk would be helpful.


Problem


The restore disks that come with the machines usually install crap in addition to the necessary files and settings. Plain Microsoft Retail Disks often don't have all the drivers the systems require to run properly.


Solution


I've decided to try nLite. Before I can install nLite, I need to install the .NET framework, version 2.0 of the .NET framework at the minimum for nLite version 1.4.9.1 .


Once the initial program requirements are met, it is as simple as installing nLite and running it. The program is very intuitive.


I wanted to use my .iso file instead of going through the trouble of burning a disk. Since nLite won't use .iso files directly (to my knowledge) I need to install a virtual optical drive to mount the .iso image in. I am using a trial version of 'Original CD Emulator', but I will probably try something else next time. You can use a real CD to make it more a more simple process.


I keep several images of my OS install disks handy for backup purposes. In addition to being able to burn new disks to avoid scratching up my originals, I can often use the .iso image file in place of the disk. I used my Microsoft Windows XP Pro SP2 image created with ImgBurn for this. ImgBurn is my favorite tool for working with disks and images. It is a freeware app that has a small footprint and is highly configurable and intuitive. I have looked at the ImgBurn configurations, but I have only used the default settings.


One of the first things it will ask you is for is the location of the files. In this case I have a virtual optical disk making my .iso file pretend to be a legitimate CD-ROM, drive E:\ .


Although not necessary, I decided to slipstream SP3 (WindowsXP-KB936929-SP3-x86-ENU) and an IE security patch (WindowsXP-KB932823-v3-x86-ENU).


It also gave me the option to install hotfixes, add-ons, and update packs. But, I don't have any. So on to the next step.


The feature I am most excited about is adding drivers. When I played with it for the netbooks I worked on, I slipstreamed SATA drivers into the install-- which worked beautifully. This time I want to add the XP networking driver pack available at driverpacks.net and see what happens. It seems like a good idea to check the delete after install box.


When adding all the drivers finished; I added another folder for common programs like the IE8, the Intel SMBus Driver, other driver installers, and sometimes anti-virus intallers.

Automating Windows Driver Installs :(

Background


As a result of needing to reload a sizable quantity of machines with Windows, which really isn't a problem once you know to find the VEN_ and DEV_ information. I wanted to automate the whole process and for some reason I thought I should figure out how the .inf, .drv, .vxd, and .sys files worked with one another. This example just happens to be for the embedded 10/100 Broadcom 440x ethernet device.


Problem


I found a compatible driver on the Dell site like I would any other. But, even though it works-- did Dell put things in there that are tell tale signs that it doesn't belong if anybody were looking? These machines were not my own where certain inconsistencies may not be tolerated. The customers paid a fair price and they deserve a good and polished product.


Another question I asked myself was, "If I streamline the process, can I shave a few seconds off the device install?" Once the .inf file is prepared you still aren't off of the hook if there is no installer with options to install via a script. There is a way to script the install but I had to dig a little to find it.


Solution


Starting with the .inf file I did a lot of reading to figure out what each of the section does.


I renamed the section I wanted in the INF file so that I could use DefaultInstall as the section the OS would choose when I ran rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 E:\ethernet\bcm4sbxp.inf from the command line. This automates the installation of device driver files.


When I was done, I realized that I could have left the section named as the manufacturer had written it and changed my commandline to rundll32.exe setupapi.dll,InstallHinfSection BCM4401NIC 132 E:\ethernet\bcm4sbxp.inf to achieve the same results.


I removed all references to the Dell Computer Corporation.


Just as unnecessary cleanup, I also removed the ASUStek and MCI lines while I was figuring out what all of the stuff in this INF file was doing since it was an eMachines laptop without ASUS or MCI hardware dependent on those lines. When everything was said and done, because it worked without the alternative sections, I did not revert to the original file to add them back in.


The edited file follows below.

;*******************************************************************************
; Copyright 2002 Broadcom Corporation.
;
; INF for 32 bit Windows XP 
;
; History:
;    06/14/02        Inception.
;*******************************************************************************
[version]
Signature	= "$CHICAGO$"
Class=Net
ClassGUID	= {4d36e972-e325-11ce-bfc1-08002be10318}
Provider	= %V_BCM%
Compatible	= 1
CatalogFile=bcm4sbxp.cat
DriverVer=12/17/2002, 3.51.0.0

[Manufacturer]
%V_BCM% = BROADCOM, NTx86.5.1

[ControlFlags] 
ExcludeFromSelect = *

[BROADCOM.NTx86.5.1]

%BCM4401.DeviceDesc%           = BCM4401, PCI\VEN_14E4&DEV_4401

%BCM4401.DeviceDesc%        = BCM4401_broadcom, PCI\VEN_14E4&DEV_4401&SUBSYS_840114e4

%BCM4401.DeviceDesc%     = BCM4401_broadcom, PCI\VEN_14E4&DEV_4401&SUBSYS_00011179

;-----------------------------------------------------------------
; 32-bit Windows XP Install sections.
;  Broadcom  Catch All
[BCM4401.NTx86]
Characteristics	= 0x84			; NCF_PHYSICAL | NCF_HAS_UI
AddReg		= BCM4401AddRegisters, AdvancedTabReg, 8021pPriorityReg, DriverInfo
CopyFiles	= BCM4401.CopyFileNT
BusType		= 5			; PCI bus

[BCM4401.NTx86.Services]
AddService = bcm4sbxp, 2, BCM4401AddService, CommonEventLog

[BCM4401AddService]
DisplayName	= %BCM4401.Service.DispName%
ServiceType	= 1			; %SERVICE_KERNEL_DRIVER%
StartType	= 3
ErrorControl	= 1			; %SERVICE_ERROR_NORMAL%
ServiceBinary	= %12%\bcm4sbxp.sys
LoadOrderGroup	= NDIS

[BCM4401AddRegisters]
HKR,	Ndi,	Service,		0,	"bcm4sbxp"
HKR,	Ndi\Interfaces,	UpperRange,	,	"ndis5"
HKR,	Ndi\Interfaces,	LowerRange,	,	"ethernet"
HKR,	Ndi,	HelpText,		,	%BCM4401_HELP%



;  Broadcom  NIC
[DefaultInstall]
Characteristics	= 0x84			; NCF_PHYSICAL | NCF_HAS_UI
AddReg		= BCM4401_broadcomAddRegisters, AdvancedTabReg, 8021pPriorityReg, DriverInfo
CopyFiles	= BCM4401.CopyFileNT
BusType		= 5			; PCI bus

[BCM4401_broadcom.NTx86.Services]
AddService = bcm4sbxp, 2, BCM4401_broadcomAddService, CommonEventLog

[BCM4401_broadcomAddService]
DisplayName	= %BCM4401_broadcom.Service.DispName%
ServiceType	= 1			; %SERVICE_KERNEL_DRIVER%
StartType	= 3
ErrorControl	= 1			; %SERVICE_ERROR_NORMAL%
ServiceBinary	= %12%\bcm4sbxp.sys
LoadOrderGroup	= NDIS

[BCM4401_broadcomAddRegisters]
HKR,	Ndi,	Service,		0,	"bcm4sbxp"
HKR,	Ndi\Interfaces,	UpperRange,	,	"ndis5"
HKR,	Ndi\Interfaces,	LowerRange,	,	"ethernet"
HKR,	Ndi,	HelpText,		,	%BCM4401_HELP%




;-----------------------------------------------------------------
;
[CommonEventLog]
AddReg = CommonAddEventLogReg

[CommonAddEventLogReg]
HKR,	,	EventMessageFile,	0x00020000,	"%%SystemRoot%%\System32\netevent.dll;%%SystemRoot%%\System32\drivers\bcm4sbxp.sys"
HKR,	,	TypesSupported,		0x00010001,	7

[8021pPriorityReg]
HKR, Ndi\Params\8021pPriority,         ParamDesc,  0, %8021pPriority%
HKR, Ndi\Params\8021pPriority,         default,    0, "0"
HKR, Ndi\Params\8021pPriority\Enum,    "1",        0, %Enabled%
HKR, Ndi\Params\8021pPriority\Enum,    "0",        0, %Disabled%
HKR, Ndi\Params\8021pPriority,         type,       0, "enum"

[AdvancedTabReg]
HKR, Ndi\params\SpeedAndDuplex,       ParamDesc,  0, %SpeedAndDuplex%
HKR, Ndi\params\SpeedAndDuplex,       default,    0, "0"
HKR, Ndi\params\SpeedAndDuplex,       type,       0, "enum"
HKR, Ndi\params\SpeedAndDuplex\enum,  "0",        0, %AutoDetect%
HKR, Ndi\params\SpeedAndDuplex\enum,  "1",        0, %10MbHalfDuplex%
HKR, Ndi\params\SpeedAndDuplex\enum,  "2",        0, %10MbFullDuplex%
HKR, Ndi\params\SpeedAndDuplex\enum,  "3",        0, %100MbHalfDuplex%
HKR, Ndi\params\SpeedAndDuplex\enum,  "4",        0, %100MbFullDuplex%

HKR, Ndi\Params\WakeUpModeCap,       ParamDesc,   0 , %WakeUpMode%
HKR, Ndi\Params\WakeUpModeCap,       default,  0  , "2"
HKR, Ndi\Params\WakeUpModeCap,       type,      0  , "enum"
HKR, Ndi\Params\WakeUpModeCap\enum,  "0",        0 , %WakeUpMode_None%
HKR, Ndi\Params\WakeUpModeCap\enum,  "1",        0 , %WakeUpMode_Magic%
HKR, Ndi\Params\WakeUpModeCap\enum,  "2",        0 , %WakeUpMode_Pattern%

HKR, Ndi\Params\FlowControlCap,       ParamDesc,   0 , %FlowControlMode%
HKR, Ndi\Params\FlowControlCap,       default,  0  , "2"
HKR, Ndi\Params\FlowControlCap,       type,      0  , "enum"
HKR, Ndi\Params\FlowControlCap\enum,  "0",        0 , %FlowControlMode_None%
;   HKR, Ndi\Params\FlowControlCap\enum,  "1",        0 , %FlowControlMode_Rx%
HKR, Ndi\Params\FlowControlCap\enum,  "2",        0 , %FlowControlMode_Tx%
;  HKR, Ndi\Params\FlowControlCap\enum,  "3",        0 , %FlowControlMode_Both%



[DriverInfo]
HKLM,Software\InstalledOptions\%DriverOEM%\%DriverFamily%\%DriverMfgr%\%DriverProduct%,Description,,%DriverDescription%
HKLM,Software\InstalledOptions\%DriverOEM%\%DriverFamily%\%DriverMfgr%\%DriverProduct%,CurrentVer,,%DriverOEMVersion%
HKLM,Software\InstalledOptions\%DriverOEM%\%DriverFamily%\%DriverMfgr%\%DriverProduct%,Ver_%DriverOEMVersion%,,%DriverVersionID%
HKLM,Software\InstalledOptions\%DriverOEM%\%DriverFamily%\%DriverMfgr%\%DriverProduct%,BaseDriverFileName,,%BaseDriverFileName%
HKLM,Software\InstalledOptions\%DriverOEM%\%DriverFamily%\%DriverMfgr%\%DriverProduct%,BaseDriverFileVersion,,%BaseDriverFileVersion%


[DestinationDirs]
DefaultDestDir = 11		; system32 on Win2k and system on win9x
BCM4401.CopyfileNT = 12
BCM4401.CopyFileW9x = 11

[SourceDisksNames]
1=%BCM4401.DiskName%,,

[SourceDisksFiles]
bcm4sbxp.sys=1

[BCM4401.CopyFileNT]
bcm4sbxp.sys,,,1

;-----------------------------------------------------------------
;
[strings]
; Provider
V_BCM = "Broadcom"

; PNP Devices
BCM4401.DeviceDesc = "Broadcom 440x 10/100 Integrated Controller"

BCM4401_HELP = "Broadcom 440x 10/100 Integrated Controller provides local area networking"

BCM4401.Service.DispName = "Broadcom 440x 10/100 Integrated Controller XP Driver"

BCM4401_broadcom.Service.DispName = "Broadcom 440x 10/100 Integrated Controller XP Driver"


BCM4401.DiskName = "Broadcom 440x 10/100 Integrated Controller Install Disk"

SpeedAndDuplex = "Speed & Duplex"
AutoDetect = "Auto"
10MbHalfDuplex = "10 Mb Half"
10MbFullDuplex = "10 Mb Full"
100MbHalfDuplex = "100 Mb Half"
100MbFullDuplex = "100 Mb Full"

8021pPriority = "802.1p QOS"
Enabled = "Enable"
Disabled = "Disable"

WakeUpMode         = "Wake Up Capabilities"
WakeUpMode_Magic   = "Magic Frame"
WakeUpMode_Pattern = "Wake Up Frame"
WakeUpMode_None    = "None"

FlowControlMode         = "Flow Control"
FlowControlMode_Both    = "Rx/Tx Pause"
FlowControlMode_Rx   = "Rx Pause"
;FlowControlMode_Tx   = "Tx Pause"
FlowControlMode_Tx   = "Enable"
FlowControlMode_None    = "Disable"


; Driver Information Entries
DriverMfgr="Broadcom"                                 ; IHV name
DriverVersionID="3.51"                                ; The IHV driver version
BaseDriverFileVersion="3.51"                          ; version of key file
BaseDriverFileName="bcm4sbxp.sys"                       ; Key file for version

; These items will be set by IHV and updated by OEM
DriverOEM="Dell"                                      ; name of the OEM
DriverFamily="NIC"                                    ; device family (NIC, Storage, Video...)
DriverProduct="BCM440X"                               ; Specific Name of device (chipset, for example)
DriverDescription="Broadcom 440x 10/100 Integrated Controller"  ; Description of device (product name, OS or system supported)
DriverOEMVersion="A00"                                ; OEM-specified version

As a note to myself about deleting the output of the find command

find / -name (insert filename parts, wildcards, and/or filename here) -print0 | xargs -0 rm

Thursday, August 11, 2011

Great Private File Server for Medium to Small Environments

Use Open Indiana with ZFS to Create a Somewhat Locked Down File Server


Install OpenIndiana v148 with SSH


You will need a system with at least four(4) disks for this example

  • The system disk
    • This disk is to put the operating system on.
    • I recommend at least 30GB
    • The faster the better
  • The first data disk
    • This the first disk of a pair.
    • Reliablilty is paramount
    • Buy as big as you can afford
  • The second data disk
    • This the second disk of a pair.
    • Reliablilty, again, is paramount
    • And buy as big as you can afford
  • AT LEAST ONE BACKUP DISK
    • RAID, ZFS, OTHER... their purpose is to help with uptime
    • ZFS also assists in somewhat painlessly growing your storage capacity
    • Backup is backup, redundant disk strategies are for use and failure
    • Buy as big as you can afford

Follow the prompts, turn on SSH, use the whole system disk.


Update the system via CLI


pkg image-update --require-new-be

The GUI tools are not working in release 148 upon installation.


Find the disk names


format

Use [CTRL + C] to exit the format command


Create the mirrored zpool


zpool create newpool mirror c2t2d0 c2t3d0

Check out your handiwork


zpool status
df -h

Create a base directory structure


newpool|-business
       |-hobby
       |-books
       |-users|-admin01
       |      |-asmith|-shared
       |      |-lsmith|-shared
       |-misc

mkdir /newpool/business/
mkdir /newpool/hobby/
mkdir /newpool/books/
mkdir /newpool/users/
mkdir /newpool/users/admin01/
mkdir /newpool/users/asmith/
mkdir /newpool/users/asmith/shared/
mkdir /newpool/users/lsmith/
mkdir /newpool/users/lsmith/shared/
mkdir /newpool/misc/

Create any groups if necessary


groupadd admin01
groupadd internal
groupadd external
groupadd common


Add any non-existing initial users


Please note that I am creating two users with two commands, they are long so the text is wrapping.


useradd -d /newpool/users/asmith/ -c "Adam Smith" -G internal,common -s /usr/lib/rsh asmith
useradd -d /newpool/users/lsmith/ -c "Luanne Smith" -G external,common -s /usr/lib/rsh lsmith

The options are as follows:

  • -d is the home directory /newpool/users/username/ in this example.
  • -c is the real name, it can really be anything. But it you want it to contain a space then enclose the value in double quotes.
  • -G list all the groups of the directories you want the people to have access to separated by commas.
    • At the very least I give membership to the common group -G common .
    • But maybe I want to give access to the external directory as well -G external,common .
  • -s /usr/lib/rsh is the 'restricted shell' to prevent a lot of funny business.

Set passwords for any non-existing initial users


passwd lsmith
passwd asmith

passwd username

(Enter password twice-- tada!)

(passwd: password successfully changed for username)


Modify existing users


usermod -G admin01,internal,common admin01

(UX: usermod: admin01 is currently logged in, some changes may not take effect until next login.)


You can verify user information in the plaintext /etc/passwd file

You can verify group creation in the plaintext /etc/group file


Apply proper owner:group properties


chown admin01:admin01 /newpool/business/
chown admin01:peers /newpool/hobby/
chown admin01:peers /newpool/books/
chown admin01:admin01 /newpool/users/
chown admin01:admin01 /newpool/users/admin01/
chown asmith:admin01 /newpool/users/asmith/
chown asmith:admin01 /newpool/users/asmith/shared/
chown lsmith:admin01 /newpool/users/lsmith/
chown lsmith:admin01 /newpool/users/lsmith/shared/
chown admin01:common /newpool/misc/

Apply proper permissions

(4 read 2 write 1 execute)

(! execute required for non-owner:group on directory to traverse file system)


chmod 700 /newpool/business/
chmod 750 /newpool/hobby/
chmod 750 /newpool/books/
chmod 711 /newpool/users/
chmod 770 /newpool/users/admin01/
chmod 770 /newpool/users/asmith/
chmod 770 /newpool/users/asmith/shared/
chmod 770 /newpool/users/lsmith/
chmod 770 /newpool/users/lsmith/shared/
chmod 750 /newpool/misc/

770 gives writability, readability, traversing to owners and group members, and nothing to others - for regular user directories

750 gives writing to the owner, reading and traversing to the owner and group members, and nothing to others - for read only access to regular users

711 gives all access to the owner, and being able to traverse the directory to everyone - allows regular users to descend deeper into the directory tree where they may have access

700 gives no access to anyone but the owner, can't even open the directory - revoke access to regular users entirely


NFS & Samba


Currently, I don't have any NFS or Samba shares set up for this server.

I will update the instructions should that change.


Set quotas


On my file server I don't plan on having many users and even fewer user groups. So far I have no plans for any quotas.


If I did set a quota, I would likely do it on a user by user basis.


zfs set userquota@username=100G newpool/users/username

However, with version 15 of ZFS user group quotas are available as well.


zfs set groupquota@common=250GB newpool/misc

More users?


Add new directories


mkdir in users /newpool/users/username/ and /newpool/users/username/shared/

Add new users


useradd -d /newpool/users/username/ -c "Fname Lname" -G [comma separated list,]common -s /usr/lib/rsh username

Change owner:group properties to new users directories


Same as above


Apply proper permissions to new directories


Same as above


Set new user password


Same as above

Wednesday, August 3, 2011

Hacking bit.ly and goo.gl

bit.ly & goo.gl users: you can add another query string pair at the end of your link. Any unused pairs are usually ignored-- which will give you not only different shortened links to share but also label one from the other.


Both shortening services are weird about shortening any URL more than once for you. This is a workaround for that by essentially making them different via adding data that will be unused and/or ignored.

Also, neither service provides you a meaningful title for your links beyond the title of the page.

http://rustbeltrebellion.com/?link=facebook
http://rustbeltrebellion.com/?link=googleplus
http://rustbeltrebellion.com/?link=twitter

Guess where I used what.

Here is an example:


Test 1
http://www.google.com/?test=1/  >>  http://bit.ly/oJdAlV || http://goo.gl/9pX4h


Test 2
http://www.google.com/?test=2/  >>  http://bit.ly/qxp4Y5 || http://goo.gl/Ob2oP

Everything above points at the same page of the same site. When your browser arrives at "http://google.com", "?test=#" is completely ignored.

(I can picture sites depending on sequential data in the query string or sites that test for query string shenanigans giving less than satisfactory outcomes-- but by and large you will be successful.)

As cool as this is for bit.ly and goo.gl users who have wanted multiple shortened urls for a single destination for tracking user interest, it is nowhere as cool as what Vitreo has going on with their QR and shortening tools.

DD-WRT control panel, no-ip, and port 80

 I'm a satisfied no-ip DDNS subscriber happily using DD-WRT.
In the no-ip settings, I have an A Name record (hostname.com) that no-ip kindly shoots straight to my house.
I also have a www C Name record (www.hostname.com) which gets some magic applied then is sent to hostname.com:webServerPort (hostname.com:8080 in my case).

www.hostname.net goes to my web server. The port 8080 traffic is handled magnificently. That is awesome.
When I type in hostname.com that is translated to my ever changing IP by my DDNS service, it takes me to the control panel of my router which listens for web browser traffic on none other than port 80--
Not so awesome. Sadness actually.
I had everything working again otherwise.

BACK UP YOUR SETTINGS.
You're going to be in there anyway, jeez man it only takes a few seconds.

I checked HTTPS and unchecked HTTP in Administration > Management > Web Access > Protocol

What this does for us is that it sets the router to listen for requests of the web GUI, the control panel, on port 443 and not port 80 anymore.

Save, Apply Settings, Reboot.
I do it whether I really need to or not, this is my house-- not a Data Center of a Fortune 500.

Now the router needs accessed with https://192.168.1.1 , heads up a certificate warning will probably pop up. The router is self certifying itself for encrypted web traffic and it is not on the preferred list of SSL certificate providers, so click whatever you need in order to continue.

After that I rerouted port 80 (since that is where the naked hostname.com from a web browser goes) via the NAT via TCP only to my webserver IP on port 80 in NAT / QoS > Port Forwarding > Port Forward > Forwards

Save, Apply Settings, Reboot.
BACK UP YOUR NEW SETTINGS.
Pure awesomeness. Enjoy.

Followers