Oct 14, 2014
TechnologyGeneral Method
When you were denied by github, use following method for get through:
Generate the key-gen
ssh-keygen
Then Creat the following files:
# cat /home/Trusty/.ssh/config
Host github.com
User xxx@xxx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
Now use following command for setting the connection:
ssh -T git@github.com
Under firewall
First add the ~/.ssh/id_rsa.pub to the github’s “SSH keys”.
If your machine runs under the firewall, you have to do things like following:
ssh -L 2121:github.com:22 root@1xxx.xxx.xxx.158
Then in another terminal, run:
ssh -T git@localhost -p 2121
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
Oct 13, 2014
TechnologyBackground
I have BeagleBone Black and RaspberryPi, both of them are cute board. Previous I use BBB for home server, which holds my own Weather APP website, also serves as a sshd server, dynamic dns server, etc. While Rpi serves like a File server and download server.
Now I want to use BBB for developing some funny things, that means I will transfer all of the functionalities which runs in BBB to Rpi. Following steps will record what I have done.
Before start, update all of the software in Rpi(it runs archLinux):
$ sudo pacman -Syu --noconfirm
sshd
Previously the sshd on BeagleBone listens on port 3333, now I have to change it back to 22,
/[root@alarmpi ~]# cat /etc/ssh/sshd_config
#Port 3333
Port 22
Restart the service via systemctl restart sshd, then you could directly ssh to 10.0.0.230.
DDns
Previous the BBB acts as the Ddns client, thus hold a no-ip.biz based domain name.
On BBB, because it runs the Debian7.1, so the no-ip2 configuraiton is :
root@arm:/etc# ps -ef | grep noip | grep -v grep
nobody 3184 1 0 Oct07 ? 00:00:01 /usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf
While the configuration file is located at:
root@arm:/etc# cat /etc/rc.local
# By default this script does nothing.
# But we will call noip in this scirpt
/usr/local/bin/noip2 -c /usr/local/etc/no-ip2.conf &
So first we should comment this line. Then activate the Rpi’s no-ip2.
The Rpi’s configuraiton is using systemd.
The corresponding configuration file is located at:
[root@alarmpi system]# pwd
/usr/lib/systemd/system
[root@alarmpi system]# cat noip2.service
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/noip2 -c /etc/no-ip2.conf
[Install]
WantedBy=multi-user.target
Simply disable it via:
$ sudo systemctl disable noip2.service
ssh with nopasswd
Make sure all of the configuration is the same in .ssh/authorized_keys
Then you could change the port in router, change the default 22 port from BBB to Rpi.
Reboot the router, and BBB & Rpi.
Sep 24, 2014
TechnologyThe following commands is for directly convert ascii, numbers in python:
$ python2
>>> str(unichr(97))
'a'
>>> str(unichr(0x68))
'h'
>>> str(unichr(0x5a))
'Z'
>>> bin(0x2711)
'0b10011100010001'
>>> 0x2711
10001
>>> hex(1127)
'0x467'
Sep 17, 2014
TechnologyAn elegant way for juding big-endian or little-endian of processor:
eCCM2-root-root> python -c "import sys;sys.exit(0 if sys.byteorder=='big' else 1)"
eCCM2-root-root> echo $?
0
[Trusty@~]$ python -c "import sys;sys.exit(0 if sys.byteorder=='big' else 1)"
[Trusty@~]$ echo $?
1
So we could see powerpc is the big-endian, while PC is little-endian.
Sep 3, 2014
TechnologyUse dpkg for reading the content and compare with the official ones:
dpkg -c ../../xxxxx_name.deb | awk '{print $3 $6}' | sort -n
Scripts for listing all of the content in the directory:
for i in `ls *.deb`
do
echo $i
dpkg -c $i
done