Jake's place

Tons of thoughs – filtered.

Author: Jake

Port forwarding with SSH

Sometimes your remote computer has access to some web service that your local one doesn’t. Firewalls and local-network servers are just too frequent.

SSH comes to rescue!

Let’s say your local machine (L) wants to access remote LAN service (D, let’s say it’s MySQL database), but all you’ve got is SSH access to one of LAN’s machines (R). Here’s the command:

ssh -fN your_username_at_R@R_address -L L_port:D_address_accessible_from_R:D_port

For our database example it could look like this (assuming that database’s IP is 192.168.0.42):

ssh -fN jake@example.com -L 3306:192.168.0.42:3306

Now just connect your MySQL client to localhost:3306 and voilà – you’d access your remote database!

Hold on! There’s one more case I dwelled upon.

Recently I got a remote service, but needed to access it from my mobile. Unfortunately I couldn’t set SSH port forwarding there, so I found that I could manipulate the command above to make my laptop proxy the service. The command looks like this:

ssh -fN your_username_at_R@R_address -L L_interface:L_port:D_address_accessible_from_R:D_port

One more thing though – you’d need to add/change one line to /etc/ssh/sshd_config, namely “GatewayPorts=clientspecified” (and for the record – I did it on Ubuntu Linux). In my case “L_interface” was IP address of my WIFI network interface (which you could look up by “ifconfig” command) which I supplied to my mobile as server address. This might not be straighforward but at least quite generic solution.

Fixing movie audio at nighttime

Since forever I face this when watching movies – I adjust volume so that I can hear dialogs well and then suddenly some explosion wakes up my whole family! Fortunately sound effects come in handy.

Specific effect we need here is called “compression”. It works quite simple: decrease loud/silent sounds ratio so that volume differences are smaller.

How to turn it on?

  • Windows: in VLC player you find that effect in “Tools > Effects and Filters > Compressor tab” (for better explanation see http://lifehacker.com/5920290/how-to-fix-movies-that-are-really-quiet-then-really-loud )
  • Linux: play movie from command “mplayer -af volnorm=2: 0.9 file_to_play.avi” (experiment with “0.9” value – it’s somewhat correlated with the desired volume compression)

Let your parents (or kids) sleep tight from now on.

Skype cheat codes

Skype and cheat codes? No bullshit!

I find some chatrooms more attention-stealing than I’d like to and besides – it’s intimidating when popups keep showing when your colleague (or boss!) peeks at your display. Should I ban all pop-ups from showing up on new message? Didn’t work – my boss kept messaging me in emergency and made it mayor issue that I responded so late. I’d be better to turn off only few chatrooms.

Some time ago it made me curious that some people write in funny mode – you get it when you type “/me secret message” as your message. Keyword “/me” changes way of displaying your message (I don’t show it here on purpose – go on and check this out by yourself!). So I checked a list of such keywords and typed “/help”…

One chat code caught my attention: “/alertsoff”. It does just what I need – turns off pop-ups of single chatroom! But what if somebody calls me personally in crowded chatroom? Hey, just use “/alertson YourName” to turn pop-ups only when somebody calls YourName (BTW – it’s case insensitive 😉 ).

One cheat code and Skype’s way more useful. Go on, tell me if it works for you too 🙂

 

Powered by WordPress & Theme by Anders Norén