Sunday, March 13, 2022

Save security camera stream video to disk

 I have a security camera that streams video. I can view the video on a web browser but I have searched up and down to find a way to save the video. I have tried VLC. It worked for a while but the newer version doesn't seem to work anymore. I've tried ZoneMinder, but it only captures when there is movement. And it doesn't manage storage space very well. 

It turns out I only need to use curl to capture the video and write to disk. I made a simple script to save videos for the last 7 days only.

curl "http://192.168.1.123/videostream.cgi" --output "file"

it's that simple.

Speaker Damping and Filling

There are two types of speaker enclosure, sealed and ported. For sealed enclosure, we want the sound to disappear inside the enclosure. So dense filling material is better. For ported speaker enclosure, we want to get rid of the standing wave/reflection, etc, but keep the Q unchanged and let the bass out. For that, we need to damp the wall with heavy material but fill the space with light, thin damping material like polyester. (see this post).

Saturday, August 20, 2016

dd-wrt openVPN setup

I have a linksys E2000 route loaded with dd-wrt firmware for a while. With all the cell phone hot spot, free WiFi, I decided to turn on the openVPN server so I can get some secured connection. Here are the steps. I will skip the ones you can find on the Web, just put the server and client config out here. That's the part took me a while to get to.

Server Config (in box of OpenVPN Config):

server 10.8.0.0 255.255.255.0
port 443
port-share 127.0.0.1 4545
dev tun
proto tcp
keepalive 10 120
dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
cipher AES-128-CBC

management localhost 5001

Note I used port 443, not the default 1194. Windows blocks port 1194 so if you want to use this port, you need to change firewalls all that. this is easier. Unless you are running a web server which is also using this port. In that case, you need to change your openVPN to forward 443 port to your server. For detail, see this post. For reasons why use 10.8.0.0 subnet, see this post.

Client Config (running openvpn)

client
dev tun
proto tcp
remote 443
resolv-retry infinite
nobind
persist-key
persist-tun
float
ca ca.crt
cert client1.crt
key client1.key
ns-cert-type server
cipher AES-128-CBC
verb 4

Then add following firewall rule into the route (Adminstration->commnds->save firewall)

iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT


Setup openVPN on a android phone;

Download openVPN App
copy client config file and all the certificates and key file listed in the config file into a directory. Then in openVPN app, import from SD card and import the client config file. You are ready to connect.,

Hope it helps.

Monday, July 18, 2016

Subwoofer project

I have a pair of PSB600i, it sounds good but with two 6.5 woofers/per side, base is not very strong. I decided to add a sub.

Looking around, eyes on Dayton Audio UM15-22 15" Ultimax. Part-express sells box with this driver, too. Plus a Yung SD300-6 300W Class D Subwoofer Plate Amp that has a 6dB boost at 30Hz. Looked at the frequency response of the driver, this looks like the right point to boost, and right amount.

Now, waiting for the materials, they are out of stock right now :-(

Amp                 $140
Driver/box:      $292

$450, any one knows anything better than this? This is for music only.

Saturday, August 1, 2015

My PSB Century 600i Speakers

I have a pair of PSB Century 600i speakers I bought quite some times ago. It never sounded right to me. The sound is small, laid back and not very clear. But all the reviews says they are good speakers. I don't understand why my is not as good. Finally, I decided to open them up and take a look. I found three issues.
  1. This is a two-way speaker. PSB uses a first order low pass and a 3rd order high pass. The low pass is at 1.5k and the high pass is at 3k. This creates a big dip at 2.2k (4dB). I guess that explains why it sounds "laid back". So I made a 3rd order low-pass crossover at 3k to flatten the response. (Another problem with 1st order 1.5k crossing point is that it may make the speaker distort. speaker like this, 6.5 in woofer, normally has a response up to 4k. With this change, the sound is much "front" and bright.
  2. the crossover uses those small electrolytic capacitors. After replacing them, the sound is much clear.
  3. It uses fiber glass as damping material. But they are not on the wall but stuffed in the middle of the cabinet. This is a reflex type of box. I read box like these need empty space to let air flow. But walls need to be damped. So I moved all the fiber glass to the wall, put some foam on the wall behind the speakers. With these changes, the speaker is much "big" and the low is coming out. The "dry" sound in the mid-high is gone too. 
With all these changes, my speakers sound much better. I understand why PSB uses 1st order low-pass and cheap capacitors (well, maybe not. This is a $400 speakers/pair, adding another $20 to the cost should not be too bad). But I don't understand why can't they make the damping right. No extra money required only a bit of care.

Anyway, I can enjoy my music now, finally.

Sunday, May 4, 2014

How to root LG F3, MetroPCS phone

This is a hard-to-root phone, too. Many popular methods did not work. Following one worked.

http://androidforums.com/metropcs-t-mobile-optimus-f3-all-things-root/812520-guide-howto-root-lg-optimus-f3.html