Tunneling SSH over a Proxy Server

200px-Squid-cache_logo

Download corkscrew from this site

http://www.agroman.net/corkscrew/

Unpack and compile corkscrew

tar -xzvf corkscrew.tar.gz
cd corkscrew
./configure
make install 

Now create a file in .ssh folder

touch ~/.ssh/config

Now edit that file

vim ~/.ssh/config

and add these lines inside config file

Host *
  ProxyCommand corkscrew http-proxy.example.com 8080 %h %p

Replace http-proxy.example.com with the name or address of your http proxy and possibly replacing 8080 with the port on which the proxy listens, which may be 80 or even some other port. The %h and %p will be replaced automatically by SSH with the actual destination host and port.

Now try ssh

ssh user@someserver.org

replace user and some server with yours.If you are getting an error like this then your proxy needs authentication

ssh_exchange_identification: Connection closed by remote host
[ OR ]
ssh: connection to host example.net port 22: Connection timed out 

Authenticated proxy connections
create a file on .ssh

touch ~/.ssh/proxyauth

edit that file and give your usrname and password like this

<username>:<passwd>

Then change your config file inside ssh with proxyauth

Host *
  ProxyCommand corkscrew http-proxy.example.com 8080 %h %p ~/.ssh/proxyauth

Happy Hacking 🙂

Send TV Remote signal using Arduino

First decode the tv remote and get the hex code for each button..This code will do that…

#include 

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}

Copy the codes for the button say for channel up is 80BFA15E…ok to send this code connect an IR Led to pin no 3..

ir

 

Check whether the remote model is NEC or SONY and use this code to send the value

#include <IRremote.h>

IRsend irsend;
const int buttonPin = 2; // the number of the pushbutton pin
//const int ledPin = 3;
int buttonState = 0; // variable for reading the pushbutton status
void setup()
{
// pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);
}

void loop() {

buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
irsend.sendNEC(0x80BFA15E, 32);
}

}

Now when the button is pressed the channel will change..If the remote is sony then use irsend.sendSony…

 

 

Happy Hacking 🙂

Arduino IR Remote identification

Download IR remote library from the following link

https://github.com/shirriff/Arduino-IRremote

Unzip the download.Rename it as IRremote and put it in arduino’s libraries folder.

To detect the remote

ir1

Set up a TSOP sensor like the above schematic…

Load the example code from File -> Examples -> IRremote -> IRrecvDemo then click the “Upload” button.Click the “Serial Monitor” button to bring up a window that will allow us to see the codes being returned to us by the Arduino. Start mashing buttons and you should see a lot of numbers scroll by like in the image below.

Screenshot-dev-ttyACM1

The ones that start off with FF and then have numbers or letters are the codes we are after. A FFFFFFFF is a continuation code and the 0 on its own line is a read error.

Happy Hacking 🙂