Support

Blog

Browsing all articles tagged with how to

Flattr this!

Despite my pendance for semi obscure cultural references (its most of the title from a decent Peter Sellers satire), I do often find useful things that people can use.

One of the things that is annoying about Windows especially is its resolute failure to find drivers when you run the “search the internet” option in XP, Vista^Hno such OS, and Win7

Example of this below:

At first we’re hopeful – maybe the gods will deign to assist us in our hour of need.

 

…but then reality comes crashing down, and we realise that we have to do the wild goosechase of running around trying to find drivers.

Wouldn’t it be nice if Microsoft actually got their act together, and put drivers online like they probably intended to?

Well, our prayers have been answered, but in typical Microsoft fashion, we still need to jump through multiple hoops to do so.

So… lets say we have some hardware in our computer that has the mystery yellow ? icon of unhappyness in Device Manager.

What to do?

First off, lets go visit Microsofts rather good, but also rather unpublicized site here:

http://catalog.update.microsoft.com

Install the cab file and sign away your life, rights and grandmother, as per standard clauses.

Bookmark this page, as its going to become very useful.

Done?

Ok, good.  Now lets return to device manager.

As I’m writing this from a Win7 box, I’ll pick something that doesn’t appear to have Windows 7 drivers post install.

SIS900 Ethernet.

If you visit the SIS website, they don’t have drivers for Windows 7.

Not all is lost though.

Lets search that site we just bookmarked

Yes!

Windows 7 drivers for the SIS900.  I’ll talk about the rather convoluted way we have to use these in a second.

For now, lets go with another example.

Lets say we have an unknown device in Device Manager in Windows, and we don’t really know what it is. 

All devices have something called a hardware ID.  This is what identifies the hardware so Windows can lookup what driver is appropriate.

I’ll pick another driver from this desktop I’m busy installing drivers for at the moment.

As you can see, we can see a list of hardware ID’s in the details tab of the property window for that device (Open up device manager, right click the ?’d device, and click properties to bring this window up)

 In Windows 7 we can finally copy the text, yay!, in older Windows OS’s we need to write down those numbers.

Lets swing back to the Microsoft site, and search for that Device_ID&Ven_ID

PCI\VEN_1039&DEV_7012&SUBSYS_0C4C105B

Woohoo!  Nice and easy – right?

Um no, remember, this is Microsoft, no Apple, so ts a little bit more complicated to use them.

Click on the driver thats appropriate for the OS in use, add to basket, then download.  You may need to try a couple of different versions if the first one you try doesn’t solve the driver issue, so pick two or three different ones.

I suggest save to the desktop.

In a few minutes you’ll find that you have a folder on the desktop with the driver in a cab file.

A cab file?  Hmm, thats not very useful, right?

Exactly…

So, we need to unpack that cab (cabinet file), and take out the juicy driver goodness so we can finally get our hardware working.

My favourite tool for this would be Winrar, so download WinRar, and install (http://www.rarlabs.com).

Installed?

Good, now right click on the cab file, and choose extract files…

Next, choose an appropriate folder name, as the defaults are too long, and winrar can’t extract the files.

In this case, as its an Audio driver, I used the cunning name of “Audio” for the folder.

Lets have a look at the folder, and see if it has an installer (usually something along the lines of Install.exe or Setup.exe.  In this case it doesn’t, so off we go back to control panel, device manager.

 We’ll try install using the driver we just downloaded.

Right click on the device, click Properties, Update Driver (usually something similar in most Windows OS’s)

Tell windows we have our own driver, and point it at the folder we just extracted.

If you are lucky you should see something like this:

Woohoo, win!

Whats strange is that Microsoft seemingly goes out of their way to make this more complicated than it really should be.

They’ve  had a driver update from the internet option in Windows since XP days.  They have this nice site with all the drivers.  They make it rather convoluted to use though. 

Wouldn’t it be nice if they put it all together and automated it?

Oh well, until we reach that perfect world, the instructions above should help you with any driver issues for Windows.

No more downloading from dodgy driver support sites, or trawling the internet for providers driver files.  Get them from Microsoft instead!

Flattr this!

One of the (not so) fun things about China is that almost everything needs to be licenced.
As part of the China bureaucracy plan, all forms of wheeled transport in Shanghai require a licence (yes, even bicycles!).

Riding motorized transport without one is not recommended, as this can lead to fines, deportation, and jail in worst case scenario’s.
This has been documented enough times by those unfortunate enough to knowingly break the law.

Electric Bikes/ Scooters are not exempt from requiring a licence, despite what the nice man at the shop selling you the bike, or others might say.

To be street legal in Shanghai, you need a plate.

1) Only bikes purchased in Shanghai can get a Shanghai plate.
Keep your official receipt (fapiao) when you buy the bike, as it needs to be used to get your licence.

2) As of a law passed in April 2008, Shanghai Electric bikes have to be:

* Under 40kg.
* Not capable of speeds faster than 20km/hr.
Effectively this means only bikes < 36v. * Listed in the allowed vehicle database for Shanghai. Legal bikes have a 15 digit unicode (like a car VIN) which is unique. Manufacturers have to apply for a production licence for this, and not all have done so. A list of licenced manufacturers is available here: http://www.shbicycle.com/Article/ShowArticle.asp?ArticleID=6230

If you own a bike that is older than that date that does not conform to the above, and you had a legal licence at that time, then it can be renewed each year, and its still legal.

3) To licence an electric bike/scooter/moped you need to visit the police station for your district.

You will need to bring:

* – The fapiao for the bike
* – Valid form of ID (Passport for foreigners)
* – The bike
* – Money to pay for the licence (11rmb currently)

—–

FAQ’s:

Can I use a legal plate from another province?
eg Jiangsu…
Possibly No, with some caveats –
It is not legal to ride with an out of town plate unless it is a weekend, or public holiday. You can be fined 200RMB if caught riding outside of these times, although this is unlikely. This is a grey area though, so police attitude to this may vary/change. While having a plate is better than not having a plate, it may not help if you have an accident.

Can I carry a passenger?
According to the law, no.

Is is illegal to drive without a plate?
Yes. Being a foreigner does not exclude you from following the law.

Do I need a driving licence for an electric bike/moped/scooter?
No.

Is there an official list of legal bikes?
There are 2 official sites where you can check if a bike is legal – http://www.shbicycle.com and http:/www.shjtaq.com

A current list of legal bikes with photo’s is here:
http://www.shbicycle.com/Photo/ShowClass.asp?ClassID=84

You will need Chinese reading abilities to read either site.

Instructions below for non illiterate:

市民在购买电动自行车时,可以通过上海市自行车行业协会网站上(HTTP://WWW.SHBICYCLE.COM),或上海交通安全信息网(网址: HTTP://WWW.SHJTAQ.COM,点击首页右上方的 “车/牌/证公告”栏目中的“上海电动自行车—上牌备案登记表”)查询该目录。

Are the cool Vespa lookalikes legal?
No.
The Vespa lookalikes / Spicy Motors bikes are not street legal for various reasons – weight, voltage, speed (unless you have a 2008 model licenced prior to 8/2008).
Additionally, they are not listed in the police database of allowed models.

…but XXX / Bike shop / my friend etc says its legal?
In short: They’re lying.

Caveats:
If you are in living a city other than Shanghai this may be ok.
Different cities, different rules.
If the bike is 2nd hand, and has an existing legal Shanghai licence, and it has been renewed each year, then it is also ok (albeit extremely unlikely).
Otherwise, see the short answer.

What about repair / warranty?
By Law, bikes have a “三包” (threefold warranty).

If you have issues within 7 days the seller is legally obligated to give your money back if you so wish.
Within 2 weeks, you are guaranteed a replacement bike.
Within 1 year, if you have more than 2 of the same type of failure, they have to replace, or you can get your money back less depreciation.
Consumables such as lights are not covered by this, nor are collisions..

Parts have the following warranties (by law):
Motor: 2 years
Frame, Fork, Charger, Controller, Battery: 1 year

*For batteries, failure is deemed as holding < 60% of original charge. More details here: http://www.shbicycle.com/news/ShowArticle.asp?ArticleID=43

Note that it is while it is illegal for shops to sell bikes that cannot be licensed, many still do.

Where can I licence my electric [bike/scooter/moped]?

Addresses for each district:

Bao Shan
宝山区 凇兴西路长征新村23号 56672872

Chang Ning District:
长宁区
天山路11弄12号
62747031

No 12, Lane 11, Tian Shan Lu

Hong Kou:
上海市丰镇路118号/上海市水电路1656号
上午8:30—11:30;下午13:30—17:00 周五下午不
受理 65161561

Feng Zhen lu / 1656 Shui Dian Lu
Closed Friday morning.

Huang Pu District:
黄浦区
山东南路49号
63289464

49 South Shan Dong rd

Jing An
静安区
昌平路372号
62539361

372 Chang Ping road (off Shaanxi road)

Lu Wan District:
思南路、香山路 交界拐角处--卢湾区非机动车管理处
卢湾区 思南路46号 63275000
46 Si Nan lu / Xiang Shan lu

Min Hang District:
上海市沪闵路4888号(莘庄镇靠近颛桥)
上午8:00—11:00;下午13:00—16:30
6489 1010-3015

4888 Hu Min lu

Nan Hui District:
南汇非机动车管理所:

上海市南汇川南奉公路6116号
上午8:30—11:30;下午13:00—17:00
电话58021896

Nan Shi District (Southern parts of City?):
南市区 中山南一路161弄5号 63138859

Pu Dong District:
浦东非机动车管理所:
上海市浦东新区杨高中路1500号上午:9:00—11:30;下午13:30—16:30 周五下午不受理电话28946594
or
浦东新区 浦东南路3640号 58394097

1500 Yang Gao Middle Road
or
3640 Pudong South Road

Putuo District:
普陀区
芦定路325号 52811677

Xu Hui District:
龙吴路2388号,徐浦大桥下面
2388/2138 Long Wu Lu, underneath Xu Pu bridge

徐汇区 龙吴路2138号(徐浦大桥) 64340579

Yang Pu District:
杨浦区
双阳路357号
65433020

Zhabei:
闸北非机所
上海市天目中路707号
上午8:30—11:30;下午13:30—17:00 周五下午不
受理 63172110

Also 闸北区 共和新路1985号 56650065

707 Tian Mu Middle Road

Flattr this!

As the Wiki for fail2ban is a little less than explanatory than it could be (and they reversed my edits which made the instructions clearer), here are my own notes on setting up fail2ban to block pop3 attacks.

Have been seeing sample dictionary attacks on some servers for a while now from random ip addresses – eg

Sep 28 13:01:03 www vpopmail[20410]: vchkpw-pop3: vpopmail user not found www@:24.153.205.71
Sep 28 13:01:03 www vpopmail[20411]: vchkpw-pop3: vpopmail user not found web@:24.153.205.71
Sep 28 13:01:09 www vpopmail[20417]: vchkpw-pop3: vpopmail user not found web@:24.153.205.71
Sep 28 13:01:11 www vpopmail[20420]: vchkpw-pop3: vpopmail user not found web@:24.153.205.71

Annoying, but not realistically going to provide much of a security issue – most of the user names are the generic ones which aren’t actually in use on the servers.

As we already use fail2ban to perform basic service blocks against naughty script kiddie wannabee’s, why not have it block vpopmail attacks also.

Our mail error logs are located in /var/log/mail.log

As you saw above, the logs show the same common text for each failed login –

vchkpw-pop3: vpopmail user not found web@:24.153.205.71

A simple regex to identify that in the logs would look like this (as per the fail2ban wiki)

failregex = vchkpw-pop3: vpopmail user not found .*@:$

First step is to create a filter for fail2ban.

Create /etc/fail2ban/filter.d/vpopmail.conf as below:

# Fail2Ban configuration file for vpopmail
#
# Author: Lawrence Sheed
#
# $Revision: 1.0 $
#

[Definition]

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
# Values: TEXT
#
failregex = vchkpw-pop3: vpopmail user not found .*@:$

# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex = 

Second step is to add our filter to the fail2ban setup

Add this to the bottom of /etc/fail2ban/jail.conf

[vpopmail]
enabled = true
port    = pop3
filter  = vpopmail  
logpath = /var/log/mail.log
maxretry = 3

logpath should be amended to whatever your mail logs for vpopmail appear.
maxretry should be set to a value that you agree with.

Restart fail2ban with a: /etc/init.d/fail2ban restart
and check that it has added the filter.

tail /var/log/fail2ban.log

You should see a line like this:

2009-10-01 12:36:09,590 fail2ban.jail   : INFO   Jail 'vpopmail' started

If so, you’re all set!


Some additional tips, as I have found some issues subsequently in Fail2ban on some systems:

If you find that fail2ban gives error 200 or 400 on occasion, this is due to a timing issue bug in fail2ban.
There are 2 possible solutions:

Solution 1 – Edit fail2ban

Open /usr/bin/fail2ban-client

Look for

def __processCmd(self, cmd, showRet = True):
beautifier = Beautifier() for c in cmd:

After for c in cmd: add a delay
time.sleep(0.5)

This should look similar to this now –

def __processCmd(self, cmd, showRet = True):
beautifier = Beautifier() for c in cmd:
time.sleep(0.5)

Save, and restart fail2ban. If you still see 200 or 400 issues, increase the delay higher e.g. time.sleep(0.8)

Solution 2 – Use a different block method

Instead of iptables, we can configure fail2ban to use route

Add a config file for this:

pico /etc/fail2ban/action.d/route.conf

Add this into the file and save it.

# Fail2Ban configuration file
[Definition]
actionban = ip route add unreachable 
actionunban = ip route del unreachable 

Open /etc/fail2ban/jail.conf

Look for ban action = … in the [DEFAULT] section, and comment it out with a # at the start of the line
then add
eg

#banaction = iptables
banaction = route

Save the file.
Restart fail2ban

It will now use route to block bad ip’s.

Flattr this!

How to get a Motorbike licence in Shanghai (from Scratch)

Go to the motorbike test place, and get the application forms. (see graphic below with address and chinese instructions).

Motorbike Licence PlaceMotorbike Licence Instructions

They will charge +-200RMB and send you to do the paperwork trail around Shanghai (mostly Minhang, with bits of Pudong depending on where you are living)

Go to the driving licence office –
Shanghai Drivers License Building:
Gate 3, 179 Qing Chun Road , Xin Zhuang (Near Chun Shen Road / Hu Min Road ). The tel. no. is 021-64987070 x 54280 or 54279

Take Passport, Drivers licence (I have a Chinese Car drivers licence), proof of Address. Residence/Work Permit (Z Visa), Photo’s
Have multiple photocopies of everything with you.  Tell them you are applying for a motorbike licence, they will give you a piece of paper with your name address, and chop it.  Off to the medical (close by).

If its more than 1 year since you did your last driving licence test, you’ll need to redo it.  This will need to be booked.
The only place in Shanghai that conducts tests in english is in Minhang.  I did my first test in Chinese, as they didn’t have foreign tests back then!

Questions / Answers are in the graphic below.
e8838ce99da2
e6ada3e99da2

Get a medical checkup.  They will give you a chopped piece of paper, don’t lose it, or neglect to get it.
Medical Checkup is done on the 3rd floor of the Dong Ming lu / Minhang
1st floor, application – 60RMB
2nd floor – photo’s and fill in the forms. (photo’s included in the price)
3rd floor – get the medical (takes about 2 minutes for all the windows, the ladies are very nice and helpful).

Back to the motorbike test place with all the paperwork, and give them the forms so far, and your passport.  They will go do the rest of the application, and give you a call in a few days to collect passport.  They will keep the rest of the forms until the licence is completed.
Currently its 750RMB to apply for motorbike lessons/ licence.   If you need to rent a motorbike at the test centre, that will cost an additional 450RMB

You’ll need at least 5 hours of lessons at the motorbike test place, possibly less if you know how to drive a motorbike already.

Once lessons are completed, you will book a road test, hopefully pass, then back to the Drivers Licence Building for a reissue of your new E licence!

My Bike is below

Flattr this!

As there doesn’t seem to be any Biltong available in China, I’m creating my own here in South Africa, so I can bring back for friends.

This makes about about 3-3.5kg of biltong once dry.
Our model for the day – my cousin Joel.

Instructions below:

Creating our Biltong Drying Box

First, go buy a plastic storage box, this needs to be fairly deep, as we will be hanging meat vertically.  Recommend buy something with an easily removable lid thats transparent for easier checking on biltong production.

We procured our box at Plastics Warehouse opposite Kenilworth Centre in Cape Town.  Carrefour in Shanghai has suitable boxes for those in China.

We prepared the box for usage, by drilling lots of small airholes in the side, and lid, swiss cheese style.  Recommend use a drill with a 1mm bit or similar.  The idea is that air can go in, but nothing else.

Once the airholes have been created, we drilled holes for dowels that the meat is going to hang on.
Dowels should be near the top of the box, and spaced appropriately.  Note that the meat cannot touch the sides of the box, so make sure to leave enough space on the left/right of the dowels for the thickest cuts of meat.  Our efforts are below:

Biltong Box

Biltong Box

Read more »

Archives

Categories

Tags

PHOTOSTREAM