posted Dec 6, 2012, 4:46 PM by Jayme Snyder
After moving back from the U.A.E., we have purchased a small little bungalo in Kitchener, Ontario. In an effort to make it mine and save energy, I have decided to invest in some DIY smart home technology.
First off, I have purchased a Radiostat thermostat. This thermostat is WiFi connected and has cloud based control (boo) and a local API (yeay!). I have begun using the local API through a Soekris net-4801 running Debian. I have written some PHP scripts that control the automation.
The first is the poller. It polls the thermostat (every minute) and the local weather station data at the University of Waterloo (every fifteen minutes) and places the data in a postgresql database only if the data has changed from last poll. The second script is the event script. It will check for certain events (calendar events/presence indicators/weather data events/etc) and take appropriate actions (adjust thermostat/email alerts/control lighting/etc.).
Finally, there is a data export script that will reformat the data into standard minute intervals (averaging values from the irregular intervals stored in the database which I will then display using HighCharts. The results (below) in MS Excel already look promising.
I have investigated some other inputs: DSC alarm panel - I am purchaing an IT-100 for integration with my DSC-1864 and existng sensors. This will help me determine presence and also control/give status for my garage doors. Dallas Semiconductor 1-wire bus solution from HW-Group they call Poseidon, but it came to almost $2K CAD for only a hadful of temp/humidity sensors. I want to monitor my fridge as well as automate the bathroom exhaust fans (to prevent mould/mildew)
For outputs: I am going to buy some insteon ceiling fan controllers and other insteon gear. I will make my outdoor lights run off a combination of moton sensors (data from DSC alarm panel), sun-times (dim after dark) and solar radiation data from the University of Waterloo weather station. |
posted Jul 2, 2011, 9:46 PM by Jayme Snyder
[
updated Jul 2, 2011, 11:31 PM
]
I am the proud owner of a 2001 Land Rover discovery. It's a great off-road toy, but one thing that has always annoyed me since I got it (second hand) is that the rear drivers side door always took a lot of force to open... and it was slowly getting worse. I decided to fix it. To fix it I needed a tool kit with torx screw bits, a flexible screwdriver attachment, allen key and small hands.
This is how to go about it:
First, remove the door trim. There are 3 screws (one on door latch release trim and two on the handles) and a bunch of clips. the clips by slowly prying the door panel away. Try to pull equally from both sides of the clips so the door panel comes straight away from the door. If you don't you will probably break the clips or where the panel mounts to the clips.
Remove the door latch release trim. The door latch release will fit through the hole as you rotate it through.
Lock the door. Unclip the power window and speaker wires, and remove the trim panel, careful not to bend the door lock rod. Unclip the connector for the power locks. You should now be able to see the door latch assembly. Watch what happens when you pull the cable and the external door latch. The action should look something like this (picture upside down, black torx scre removed), the solid lines should move as a single piece.
In my case, when you pulled the external door latch, it pulled the rod, but there was a lot of play before the latch that moved with the cable release moved. This play was caused by an alen bolt that is used to adjust the pull distance of the rod for the external door release.  To get at the allen bolt, you could either remove the entire window assembly, allowing you to remove the latch assembly or you can work with the latch assembly in the door. I chose the latter option.
I removed the lock rod and external release rod (don't drop it in the door). Then undid the screws for external door lever/handle. To remove the handle, slide it towards the front of the truck(it may need a nudge), then gently pull it out from the back of the truck as if you were opening the door. I then released the 3 screws that hold in the latch, carefully oriented it inside the door as so that I could remove the black torx screw with a flexible attachment screwdriver extension. Once the black torx screw was removed, I exposed the loose allen bolt,
adjust the mechanism as appropriate, tightened, test fit, and re-assembled.
It appears that this might be a little bit of a design aggravated issue, as forces from opening and closing the door could back off an insufficiently tightened adjustment bolt. Although the issue appears to be fixed for me, I think maybe I could have put some lock tight on the bolt or used a lock washer. From factory it probably should have had a lock washer. Installing one while the assembly is in the door will likely result in pieces falling into oblivion. Anyway, hopefully I will never do this again.
|
posted Jul 2, 2011, 8:54 PM by Jayme Snyder
Ever had a couple servers that although ILO was configured, the person who set it up had left and documented the credentials somewhere you don't have access to?
Fear not, at least if you can boot the box into some form of linux. It is trivial to reset the ILO credentials from Linux. In this case I had Fedora Core 13 running on an DL380 G6.
First, go to www.hp.com and download the Proliant Support Pack for your version of Linux and HP server.
It comes in a tar archive, extract it into a directory.
Make sure you have net-snmp installed on your server, if you don't, install it with `yum install net-snmp` or however.
Install the hp-health, hp-snmp-agents and hponcfg packages. I did: rpm -i hp-snmp-agents-8.7.0.23-16.rhel6.i386.rpm hp-health-8.7.0.22-16.rhel6.i386.rpm hponcfg-3.1.1-0.noarch.rpm
If you don't know for sure the user name, use hponcfg to retrieve your current ILO configuration (does not include passwords of course)
hponcfg -w currentcfg
In the xml file currentcfg, you will see a section that looks like: <USER_INFO MODE="write"> <ADD_USER USER_NAME = "Admin User" USER_LOGIN = "AdminUser" PASSWORD = "%user_password%"> <ADMIN_PRIV value = "Y"/> <REMOTE_CONS_PRIV value = "Y"/> <RESET_SERVER_PRIV value = "Y"/> <VIRTUAL_MEDIA_PRIV value = "Y"/> <CONFIG_ILO_PRIV value = "Y"/> </ADD_USER> </USER_INFO>
Note a user which has ADMIN_PRIV value of Y that you wish to reset.
Create some new XML like this:
<RIBCL VERSION="2.0"> <LOGIN USER_LOGIN="Administrator" PASSWORD="thispasswordisnotchecked"> <USER_INFO MODE="write"> <MOD_USER USER_LOGIN="AdminUser"> <PASSWORD value="NewPassword"/> </MOD_USER> </USER_INFO> </LOGIN> </RIBCL> Note the values you change are in MOD_USER. In this example, we would change AdminUser's password to NewPassword
Run hponcfg with the -f option specifying your xml. It will run and your ILO password should be reset. hponcfg -f resetpw.xml
Khalas
|
posted May 28, 2011, 8:46 PM by Jayme Snyder
The number one rule to removing ad-ware and viruses is to make sure it cannot re-install and infect.
This means doing updates, and, stopping it from writing to the filesystem :)
In case of skype, under advanced, un-check automatically run add-ons.
Find the folder where easybits runs from, delete its contents and set system deny permission.
|
posted Apr 28, 2011, 3:12 PM by Jayme Snyder
[
updated Sep 3, 2011, 1:46 AM
]
I wrote my first google gadget and got the social comments somewhat working on google sites!
The gadget XML can be downloaded here: www.jayme.ca/fbcomments.xmlJust copy it to your site's attachments and add it using add gadget wherever you want your comments box.
If you have HTTPS enabled in your security you get a warning on secure vs. unsecure mix. Also, I am still having issues getting the moderation working. Not sure if this is directly related to the inability to modify the meta tags, but I assume it is. So, please don't spam my blog :D
|
posted Apr 25, 2011, 12:20 AM by Jayme Snyder
[
updated Feb 4, 2012, 10:03 AM
]
I have always liked to take things apart and put them back together. I started fixing laptops and delecate electronics and over the years, I have gotten pretty good at troubleshooting.
Here are some of the more memorable repairs:
When I was 14, I wanted a cell phone, so I went out and got a cool new Mitsubishi G310. Being the geek I am, I wanted it to be different then anyone else's cell phone. Sure, I changed the face plate but that wouldn't impress the local linux users group... so I bought blue surface mount diodes and replaced the green ones. The thing about surface mount diodes is that if you heat them too much, they melt and lose their brightness. After the 18th one I was becomming quite the professional. When all was said and done, I marveled in the blue back light on my phone.
I had one customer who was going to throw away their laptop because it didn't work and needed a new motherboard to fix it. The customer was told this by multiple shops. I asked specifically what the problem was and they told me that the wireless stayed disabled no matter how the hardware switch was configured. Previous shops had ripped the notebook apart multiple times and replaced the wireless card and fiddled with the switch, charging several dollars each time. I asked to let me try and even though he was skeptical and fixed the issue in less then half an hour. Simply I identified the problem with the radio switch. Looked up the mini-pci express specifications and bypassed the radio disable circuitry on the wireless card by taping off and isolating the pin that controls the radio power down. I explained to my customer the implications; his radio disable switch does nothing and he shouldn't let anyone remove the radio card without noting the issue.
I had a friend who on Facebook was asking how to replace their ECU on their car. I asked her why she has the idea to replace the ECU on her car. Apparently, she reversed the jumper cables while boosting her car, and now would not start. She brought it to multiple garages which said she fried her ECU. This seemed pretty odd to me - I have a bit of an understanding of vehicle electronics so I offered help. I asked her what happens when she turns the key, to which she replied "nothing". I asked about the radio and headlights, which also did not turn on. At this point it was obvious that all electronic systems in her car were dead which means it must be something that has to do with all of the vehicles electronics. It was obvious that the previous garages who recommended her ECU be changed did not have an understanding of the problem or did not understand the vehicles electronic systems. The ECU does not control all systems. The ECU would be coded to the immobilizer in this vehicle, requiring reprogramming or tampering with the anti-theft system. Being a late 90's Acura, it isn't that complex of a vehicle and wiring diagrams are easily obtained. The ECU is designed to be robust, tolerating voltage spikes and drops that are typical and expected in automotive applications. In line to most systems are a few fuses and the ignition switch, but not the ECU. I told her to look under the hood for the master fuse box for the 80A battery fuse. A $8 fuse later, she was driving her car again.
A friend of mine had a Blackberry full of his businesses data. One day, several months after his last backup, the USB/charging port broke. He went to his cell phone provider which told him he is now SOL and there is no way to transfer the data off of his old phone and no way to fix it. I offered to help. First, I replaced the battery with a fresh one and then backed up his phone to my PC using Bluetooth. Restoring the data on to his new Blackberry his carrier convinced him to purchase. After, I used the lost art of soldering to replace the connector, making the old blackberry good as new. In this case, it seems the agents operating for the carrier were either ignorant of the phones features, unwilling to help, or insensitive to the importance of their clients data.
Another friend of mine owned a computer shop. One of his clients had bought an IBM laptop and accidentally set and forgot his BIOS password. My friend bought the laptop back from him and sold another. After he tried many passwords, I decided to take a shot at recovering the password... being a high-school co-op for a tech company that manufactured hardware, I asked for a few resistors and and capacitors to build a serial interface for an eeprom. They only had surface mount components, so I layed them out so that they were as close as possible and superglued them to a piece of paper, completing the circuit with solder and tiny pieces of wire. I re-assembled and powered the laptop on my desk with the interface attached and used another laptop to read the contents of the eeprom. The password was the guys first name.
|
posted Apr 12, 2011, 12:12 AM by Jayme Snyder
[
updated Apr 28, 2011, 3:05 PM
]
So out of the box, fragroute doesn't compile. If you try, you probably get complaints about missing libdnet and libevent. First, libevent. Passing "--with-libevent=/usr/include" would catch that event.h is there, but because event.a is in /usr/lib(64)/, it still won't work. I just symlink'd it in to /usr/include. The libdnet is looking for is lib dumnet, not libdecnet. If you `apt-get install libdumnet-dev` it will still complain. They have renamed dnet.h to be dumbnet.h, so in /usr/include I did another symlink and passed "--with-libdnet=/usr/include" to configure. It complained about missing bin/dnet-config... so created another symlink. Now, it mostly will compile after being configured... except it will error with: fragroute.c:151: undefined reference to `event_gotsig' fragroute.c:181: undefined reference to `event_sigcb' I just commented those lines out... yeah... seriously... I did. I broke the signal handling of the application. This is not the best solution for all of this. I could find and compile against the older version of libevent(1.4.12) and dnet. I could fix the config script to look in the right places... and I could even find someone to fix the signal handling of the app or learn c and fix it myself using evsignal_set() and evsignal_add().. But I didn't... So, in summary: sudo apt-get install libdumbnet-dev sudo apt-get install libevent-dev sudo mkdir -p /usr/include/bin/ sudo ln -s /usr/lib64/libevent.a /usr/include/libevent.a sudo ln -s /usr/include/dumbnet.h /usr/include/dnet.h sudo ln -s /usr/bin/dnet-config /usr/include/bin/dnet-config vi fragroute.c :151 /* event_gotsig++; */:181 /* event_sigcb = fragroute_close; */./configure --with-libevent=/usr/include --with-libdnet=/usr/include |
posted Feb 28, 2011, 6:30 PM by Jayme Snyder
[
updated Apr 28, 2011, 2:59 PM
]
The process I thought of was this:
- Parse the css for all colours
- Make an image using the text input format to imagemagick
- Change the image with modulate or similar imagemagic commands and output back to text
- Parse the image files and map colour to colour
After a bit of hacking it together, I ended up with something like this:
IFS=' ' i=0 echo "# ImageMagick pixel enumeration: 1,90,255,RGB">img.txt for colour in `cat skin.css|sed "s/.*\(#[1234567890ABCDEFabcdef]*\).*/\1/g"|sort -u|grep ^#....`; do red=`echo $colour|awk 'END{print "ibase=16; " toupper(substr($1,2,2))}'|bc` green=`echo $colour|awk 'END{print "ibase=16; " toupper(substr($1,4,2))}'|bc` blue=`echo $colour|awk 'END{print "ibase=16; " toupper(substr($1,6,2))}'|bc` echo "0,$i: ($red,$green,$blue) ${colour}">>img.txt i=$[i+1] done convert txt:img.txt -modulate 100,100,-10 -depth 8 txt:img2.txt for colour in `cat img.txt|grep "#[1234567890ABCDEFabcdef]"|sed "s/.*\(#[1234567890ABCDEFabcdef]*\).*/\1/g"` do line=`cat img.txt|grep -n "$colour"|awk 'BEGIN{FS=":"}{print $1}'` newcolour=`cat img2.txt|awk "NR==$line{print}"|grep "#[1234567890ABCDEFabcdef]"|sed "s/.*\(#[1234567890ABCDEFabcdef]*\).*/\1/g"` echo "$colour -> $newcolour" done
Which when run, produces:
#083658 -> #581208 #105278 -> #781610 #1C3135 -> #351C1F #277193 -> #932827 #30F9FF -> #FF3068 #3381A1 -> #A13334 #3F91AF -> #AF3F42 #547074 -> #745459 #5A5A5A -> #5A5A5A #7FCEF1 -> #F17F7F #928E81 -> #818A92 #9FC8D7 -> #D79FA0 #BAC0A2 -> #A2A5C0 #C0DBE5 -> #E5C0C1 #CFCBBF -> #BFC7CF #CFE3EB -> #EBCFCF #DADDCB -> #CBCDDD #DBDDCC -> #CCCFDD #dbe9ed -> #EDDBDC #DFEDF2 -> #F2DFDF #E3E5D8 -> #D8D9E5 #ECEEE5 -> #E5E5EE #EFF6F8 -> #F8EFEF #F6F6F2 -> #F2F3F6 #FFFFFF ->
Just need to use sed to change the values in each file and then bam - instant colour hack
|
posted Feb 23, 2011, 8:50 PM by Jayme Snyder
[
updated Apr 28, 2011, 2:47 PM
]
I didn't like the colours of the bwoup theme as they didn't match the company branding. The skin selection for DTC is not very extensive, and bwoup would have been fine had it been a different colour. My solution - change the colour of all the graphics. Photoshop would be too slow. First, I copied the bwoup theme to my new theme directory: hostnow Second, edit skin.php and layout.php, change all occurrences of bwoup to hostnow: cp layout.php layout.php.bk; cat layout.php.bk|sed -e "s/bwoup/hostnow/g" > layout.phpcp skin.php skin.php.bk; cat skin.php.bk|sed -e "s/bwoup/hostnow/g" > skin.phpThird, use magic to copy changed graphics colours into new skin. I rotated the hues from blue to red using the modulate command option. cd /usr/share/dtc/shared/gfx/skin/bwoup/gfx/for image in `ls *.gif`; do convert $image -modulate 100,100,-10 ../../hostnow/gfx/$image; donecd navbarfor image in `ls *.gif`; do convert $image -modulate 100,0 ../../../hostnow/gfx/navbar/$image; donecd ../treeview/for image in `ls *leaf*.gif`; do convert $image -modulate 100,100,-10 ../../../hostnow/gfx/treeview/$image; donefor image in `ls *tv_tree*.gif`; do convert $image -modulate 100,100,-10 ../../../hostnow/gfx/treeview/$image; doneFinally, set the skin in DTCs control panel, view your changes and use a color picker to identify the colours in skin.css which need to be changed and correct the little things. cp skin.css skin.css.bk; cat skin.css.bk | sed -e "s/1C3135/351C1C/g" -e "s/1C3135/351C1C/g" -e "s/277193/CC0000/g" -e "s/083658/580606/g" -e "s/EFF6F8/F8EFEF/g" -e "s/3F91AF/AFAFAF/g" -e "s/277193/939393/g" > skin.cssMy early results of skinning Hostnow's control panel for managing the hosting (still needs icons):
**UPDATE 02/28/2011** just added this to the offical GPLHost Wiki
|
posted Feb 2, 2011, 1:11 AM by Jayme Snyder
[
updated Apr 28, 2011, 3:01 PM
]
So I found myself in a situation today where I wanted to copy a file off my computer onto a remote machine located inside another network. I control the network, but there are security concerns which prevent me from wanting to use RDP or put any password that is used elsewhere into memory on this remote machine. I was also behind NAT from my client PC. Instead of copying the file to another machine which was directly accessible with a webserver, and then pull it from there, I decided just use a SSH tunnel to bind my port 80 to a server accessible to both. Basically port forwarding from your client accessible network to a remote server: On the SSH server that will become the server providing your content: edit /etc/sshd_config Add: GatewayPorts yes restart sshd (in my case freebsd, so /etc/rc.d/sshd restart) On the client with access to the network with the service you want to map/distribute: ssh -R \*:<remote-server-port>:<local-server-with-content>:<local-server-port> <username>@<remote-server-that-will-provide-content> So in my case, the server running on my local machine one port 80 to a remote machine on 8080 would look like this: ssh -g -R \*:8080:localhost:80 ns1.00000000.ca Please note this is actually a major heads up to think about network security. Even if you are protecting a network with stateful packet inspection, remember that traffic which was established from trusted networks to outside can tunnel untrusted connections back in - so in a truly secure network one must enforce security on outbound traffic. |
|