Shop alarm gate tag dissected
Tuesday, March 26. 2013
Everybody who has ever been to a store has seen those electronic gates which are meant to keep shoplifters from stealing stuff. Normal shoplifters use some kind of countermeasures and are actually not bothered by the gates, only honest people get to suffer from them. Typically the gate triggers the alarm by accident when shop personnel simply forgot to remove the tag, or sometimes a rolled wire of some sorts will resemble a coil so that the gate thinks that my recently bought extension cord and/or Ethernet cable is an anti-theft tag. The other not-so-typical scenario is that, there is a tag attached to thing that you bought, but the gate does NOT trigger the alarm. Well, this time that's what happened.
I'm at home and realize, that there is a tag attached. It looks ugly and annoying and should be removed. Since I've always wanted to know how do they remove them in the shop, I took my trustworthy Dremel and started cutting.
Here are the pics:
It looks that there are 4 lightly magnetic ball bearings inside a small cavity made out of plastic and steel. The steely part of the cave is also magnetic so that it attracts the ball bearings to stay on that side. Then there is the part they remove in the store, it is a metallic stud which really doesn't move a lot when pulled. If a lot of force is applied to the stud, the four ball bearings are tightening to the direction of the pull, so that is it impossible (or very very hard) to actually succeed in removing the stud from the tag. In the store (you see them next to the cash register) they have a powerful magnet which is applied to the plastic side of the tag. When the tag is placed on top of the magnet, it pulls the ball bearings down (with the help of gravity), making the stud move away. A removed stud slips back to the tag very easily without magnets or anything, the ball bearings just move out of the way.
The tag is fully covered with plastic and most of it is a coil for the gate. Normal tags don't have sharp edges or brownish dust from dremeling. This one does, since I literally cut it half. The white plastic part in the 2nd pic is typically covered with the black plastic. Also the stud in the pics 3 and 4 is bit longer, since it is not cut short with a power tool.
Next question typically is: How to remove them next time without cutting/breaking the tag? My answer is that I don't know. My tag is busted anyway, but next time I have one that is not busted, I'll try applying some sort of magnet and hitting the tag to the direction of the magned. Eventually, it boils down to the magnetic force, so a powerful one is recommended. I don't know if I have one that has enough pull in it, but I'll sure try. Another thing that comes into mind is to keep twisting the stud while pulling, it should make the ball bearings roll and stay loose enough.
openSUSE 12.3 upgraded
Monday, March 25. 2013
Couple of weeks ago openSUSE-project released their latest desktop-Linux. That is the distro The Man himself, Linus Torvalds had a dispute about security policy of needing a root access to add a new wireless network. He actually said that openSUSE-people are morons. A year ago, they were very defensive and insisted that Mr. Man had it wrong. In reality: no other operating system requires demi-god permissions to do such a trivial task. In 12.3 the morons finally got it, connecting to a new wireless LAN does not require any special permissions.
My hardware for running a desktop-Linux is a very old Apple MacBook. The Mac OS X system info says, that this is a 1,1 hardware, making it pretty much one of the first ever Intel Macs there exists. It has two gigs of RAM and enough hard disk to run pretty much any modern disto. Being a Mac, it also has enough Intel chips in it to fulfill any requirements that modern distros have for 2D or 3D graphics, sound or display. It definitely lacks the I/O or CPU power that any not-6-years-old laptop might have, but it is very suitable for running a desktop-Linux. Mr. Torvalds prefers Apple Airs, but I didn't want to spend that much money on an used computer.
openSUSE install just keeps on improving. I always back up the old computer and do a fresh install, I sure haven't met a working operating system upgrade ever. During installation, all the settings are there if you need the, but the defaults are very good making the entire process flow smoothly. This time there was a glitch when the Atheros WLAN-chip was not auto-detected during install. I had to manually go configure network devices and add a wireless device. At that point the ath5k driver was detected and I got the box connected to The Net for the rest of the install. No other special things there.
After install the first thing I got was the pommed-package. It makes the Apple-keys work in Linux and is definitely needed. My keyboard layout is Finnish, so I also had to compile keyfuzz to get rid of those useless Apple-keys which are called Meta-keys in Linux. I need my alts, and do the following mappings:
# Map Alt to Meta
458978 125
# Map Meta to Alt
458979 56
# Map Right Meta to Right Alt
458983 100
The final thing to do is to get the iSight-camera working. All it requires is the Apple-copyrighted firmware and it is ready to go. What I did, was to restore my previous file from a backup, but if you need to get one for yourself, there is ift-package or iSight Firmware Tools. With that you can extract the needed bits from Mac OS X device driver and place the resulting file into your Linux. There already is a Linux kernel-module isight_firmware waiting for the file to appear. As a result a brand new Video4Linux-device should appear and you can test it with MPlayer (that breaks couple of dozen copyrights and you need to get from The Net):
mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -fps 30
The 12.3 runs clearly much faster than 12.2. I have all the KDE4-desktop effects enabled and 12.2 really couldn't manage the 3D-graphics. 12.3 seems to be able to get more juice out of the Intel's 945 GPU. With all the modern software and latest Linux kernel the open-source -guys are finally getting there (with support from Novell, of course). This is actually a very usable desktop for a geek like me.
openSUSE 12.3 get's my seal-of-approval with a bonus thumbs up.
Windows 7 unable to detect a HID barcode scanner
Thursday, March 21. 2013
This is a really weird one. On 64-bit Windows, a regular USB bar code scanner is not detected as a HID-keyboard. Actually it falls into smthing really weird -category in the USB-devices. And needless to say, but the scanner effectively does not work. Windows simply states that "driver not found" and adds that "device may not function properly". I tried upgrading the driver from Device Manager, but no dice there.
Couple of users are complaining the same thing, but one actually has a solution. The idea is to first connect a real keyboard into USB-port and after that the barcode scanner. WTF?! It actually works! Windows gets fooled enough by the actual keyboard, that barcode scanner works even if the real keyboard is unplugged. It's just that an actual keyboard needs to be present during the driver detection.
I had couple of Zebex scanners and tried to make them work with my Windows 7, but all I got was frustration and no tangible results (beside the keyboard trick). I had a the-cheapest-there-is -model and a proper one, but there was no real difference in how Windows saw them. Based on the reports available in the Net, this is not a single manufacturer issue, its more like a Windows HID-keyboard issue. Then I was doing something else for a while, enough for the laptop power saver to kick in. When I got back to the computer and slapped it up from the sleep, then miraculously Windows detected the already plugged in barcode scanner as a HID-keyboard!! WTF?! #2
Ever since, both scanners have been functioning ok. Also, I'm pretty sure that now my laptop has been "tainted" and I cannot continue my tests with it anymore. I'd probably should re-install entire operating system just to confirm the results. But I'd rather not.
If anybody can explain what happened there, please drop a comment.
Transferring MySQL Enterprise Monitor Service Manager to a new server
Wednesday, March 20. 2013
MySQL Enterprise Monitor is a really good tool to see what's going on in the DB. At least I'd like to give my DB-box all the possible resources, I'm running the Service Manager -part in another server.
Sometimes there is a need to upgrade servers. This time it moving other roles out of the way was piece-of-cake, except the Service Manager. In the entire Internet, there is no spot-on information about how to do it in detail. The only really relevant information I could find is B.5. Backing up MySQL Enterprise Service Manager in the MySQL documentation. In the doc they manage to describe how to back things up, but not really how to restore anything.
I did the operation in following steps:
- Fresh installation of Service Manager in the new server
- I chose not to configure anything and ended the installation there
- Backup of the data as described in the doc:
mysqldump --single-transaction -uservice_manager -p -P13306 -h127.0.0.1 mem > mem.dump - Restore of data into the new server using command like:
/opt/mysql/enterprise/monitor/mysql/bin/mysql -u service_manager -p -P13306 -h 127.0.0.1 - In the DB-server the Enterprise Monitor Agent needs to be reconfigured to send information to a new Service Manager
- Edit file /opt/mysql/enterprise/agent/etc/mysql-monitor-agent.ini
- Confirm value of agent-mgmt-hostname
- Confirm value of aggr-mem-baseurl
- After these changes a login to the newly setup Service Manager showed the DB as fully functional
Hope this helps somebody.
Windows update stuck forever: "Operations are in progress. Please wait. The machine will be turned off automatically after the operations are complete."
Tuesday, March 19. 2013
That happened to me with March 2013 updates. The machine was stuck with "Operations are in progress" -message for 12 hours. At that point I deduced that it is unlikely for the machine to actually be doing anything.
The real question is: What to do?
- Force the thing into reboot cycle?
- Wait a while longer?
I chose 1. and was ready for the smelly thing to hit the fan. Nothing happened. Windows finalized the updates during boot, which is pretty much normal in the circumstances. After that I logged in and everything worked fine.
Hyper-V and CentOS 6.4 - Revisit
Tuesday, March 12. 2013
I bumped into couple of issues earlier. Article about missing Integration Services and Networking Status: degraded.
RedHat managed to package the Integration Service drivers into RHEL 6.4 which essentially is the base of CentOS 6.4. So, from now on the much required drivers are bundled in the installation source.
There are no major changes in the drivers, though. Network status is still degraded and a hint of upgrading the drivers is there. It seems to be a mystery to everybody how to do the upgrade.
The list of integration services is unchanged:
- Operating system shutdown
- Time synchronization
- Data Exchange
- Heartbeat
- Backup (volume snapshot)
This article in Microsoft's social network describes the changes. Looks like Dynamic Memory (ballooning) is the only new feature. That wasn't even in the RHEL 6.4 beta, but they pushed it into final release.
Apple Time Machine backup over AFP-share hosted on Linux
Monday, March 11. 2013
Current Linux implementation (Netatalk) of Apple Filing Protocol does support all the good stuff properly. Mainly:
- DHX2 (Diffie-Hellman Key Exchange 2) -based authentication: the old auth was plain-text, this is a huge improvement, all modern OS Xs have this as mandatory
- AFP Lock Stealing, + couple of other features: See Apple's requirements for Time Machine server
In my case, there is a HFS+ sparse file on an EXT4-partition. Setting this up with Time Machine is a breeze, however TM will "think" a while before mounting the sparse file and actually running the backup. There are a couple of user testimonials that occasionally (too often) TM will freeze and fail to do a backup. Also when the failure occurs, TM will fail to continue operation and a full backup media reset will be required.
The source of my information is QNAP wiki, which describes the process on old(ish) Mac OS X and Netatalk. I got my backup running based on that information. Also, if there are earlier reported failures to backup, I'll report back here.
Runnig Samba (SMB/CIFS network share) with OpenLDAP
Sunday, March 10. 2013
The above setup sure is a bitch to get running. There is plenty of documentation and tools scattered around the Web, but it looks like the user funnel goes something like this:
- 1.000.000 users running Samba on their Linux
- 1.000 out of the above users are running OpenLDAP on their Linux(es)
- 1 out of the above users are running Samba with passdb backend = ldapsam
In the end, there is no definite document or tool to rely on. I spent about two weeks gathering information and trying out various approaches. I had to run my LDAP-queries unencrypted while sniffing the traffic with Wireshark to get an idea what kind of information is being requested.
In the end, just getting LDAP working on your server(s) is difficult enough for most people to get discouraged by the constant failures while attempting the setup. The advantages are there, being able to authenticate SSH-shell, secured web pages, WebDAV and any number of applications against exactly same user name / password -pair in a tested and secure manner is an execllent reward. Just having HTTP Basic Auth running against existing Linux userbase without LDAP is very difficult and mostly requires poking unnecessary holes to system security to get it running.
One of the really bad things is that not all documentations describes a simple step-by-step -process of making the setup secure. There is no need to allow all access to everybody, for example a simple:
olcAccess: {0}to attrs=userPassword,shadowLastChange
by self write
by anonymous auth
by dn="cn=admin,dc=example,dc=org" write
by * none
will make harvesting accidentally stored plain text -password much more difficult than the out-of-the-box solution does. All stored LDAP-passwords should be hashes, right? Not all tools default doing that.
When all the Samba-parts are in the LDAP, the above issue raises again. Using LanManager-passwords is out right stupid, they can be brute-forced with ease, but NTLM-passwords need to be protected with similar access-line:
olcAccess: {1}to attrs=sambaLMPassword,sambaNTPassword
by dn.base="cn=admin,dc=example,dc=org" write
by dn.base="cn=sambaservers,dc=example,dc=org" write
by anonymous auth
by self write
by * none
After that, there is some sanity in system setup.
To get all the "Samba-parts" working into your LDAP, Microsoft Knowledgebase article Q243330 about Well-known security identifiers in Windows operating systems is a must-have reference. While debugging the LDAP-queries you will face something like this:
ldapsearch -x -b "dc=example,dc=org" \
"(&(&(objectclass=sambaGroupMapping)(sambaGroupType=4))
(|(|(|(|(|(|(|(|(|(sambaSIDList=S-1-1-0)(sambaSIDList=S-1-5-2))(sambaSIDList=S-1-5-11))
(sambaSIDList=S-1-22-2-1099))
(sambaSIDList=S-1-5-32-545))
(sambaSIDList=S-1-22-2-1101))
(sambaSIDList=S-1-22-2-1102))
(sambaSIDList=S-1-5-32-544)))))" cn gid
Initial impression will be WTF!? However, most of the SIDs are needed in your LDAP to make Windowses happy.
Some kind of setup wizard would be nice. It would save couple of weeks debugging / setup time.
Comment spamming - Akismet
Sunday, March 3. 2013
Looks like running a blog has surpassed e-mail as the means of conveying spam. I wrote earlier about lot of automated comments, but the freemason idiots seemed to stop as they realized that their valuable information is not getting posted.
It does not mean, that I was left alone. Couple of other idiots started the same thing and I had to do something to stop their stupidity. So, I created a personal account at Akismet, there are plenty of information about them and most of the comments are about how using their service stops the spam flood completely. Luckily Serendipity supports Akismet's service out-of-the box and the setup was very simple.
Looks like, they're doing the same thing for blogs as SpamCop is doing for e-mail. And that is, essentially grinding spamming to halt. SpamCop have proven their value, it remains to be seen how effective Akismet actually is.