Tag: linux
sshpass, scp and feh. Sending files over ssh without prompting for a password
10/07/2017
I got a Raspberry Pi as a webcam/timelapse setup. I thought it would be fun to also send it to my other Pi so it would show up on my desktop.
This how I did it.
First I needed to send the file from the PiCam to the PiDesktop and I use SSH and SCP. The thing is, with SCP you need to enter a password and because we run it in on a cronjob we have a problem.
This is how you can get arround that. Use SSHPASS.
First we need to install sshpass:
1 2 3 4 5 |
wget http://sourceforge.net/projects/sshpass/files/latest/download -O sshpass.tar.gz tar -xvf sshpass.tar.gz cd sshpass-1.06 ./configure sudo make install |
Then you can use it like this:
1 |
sshpass -p 'PASSWORD' scp /home/picam/pictures/lapse.jpg pi@192.168.x.xx:/home/pi/webcam.jpg |
Yeah its not secure. Follow the links to read more about a better approach.
As it arrives on the PiDesktop, FEH will pick it up and sends it to a nice picture windows.
1 |
feh -q --scale-down -R 60 -g 648x356 /home/pi/webcam.jpg |
Sources:
https://www.tecmint.com/sshpass-non-interactive-ssh-login-shell-script-ssh-password/
https://linux.die.net/man/1/feh
https://www.linux.com/learn/cool-linux-command-line-image-management-hacks
This is a better way to connect with SCP and a password:
https://kb.iu.edu/d/aews and https://alvinalexander.com/linux-unix/how-use-scp-without-password-backups-copy
Share the post "sshpass, scp and feh. Sending files over ssh without prompting for a password"

Fix mount issues Linux and Windows 8 NTFS
27/07/2014
Windows 8 has a option that you can boot faster. It stores (hibernates) your system. Sometimes Linux can’t mount your local disks and it will give you this kinda error:
Unable to mount location
Error mounting /dev/sda2 at /media/pieter/DATA: Command-line `mount -t “ntfs” -o “uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177” “/dev/sda2” “/media/pieter/DATA”‘ exited with non-zero exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount ‘/dev/sda2’: Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the ‘ro’ mount option.
What worked for me was to disable the “fast start” option in windows 8.
1. Open Control Panel and choose Power Options.
2. Click on “Choose what the power buttons do”.
3. Click on “Change settings that are currently unavailable”.
4. Uncheck “Turn on fast startup (recommended)”.
If you want to try some more options this page might help you:
http://www.hecticgeek.com/2013/01/mount-windows-8-partition-ubuntu-hybrid-boot/
Share the post "Fix mount issues Linux and Windows 8 NTFS"

Install .deb Packages (Linux)
01/07/2014
Sometimes its handy to just install a .deb from the command line..
1 2 |
dpkg -i package.deb dpkg --install package.deb |
Got a few packages in a subdir and want to install them all at once:
1 2 |
dpkg -i -R /path/with-many-deb-files/ dpkg -i --recursive /path/with-many-deb-files/ |
Share the post "Install .deb Packages (Linux)"

ssh stuff
01/07/2014
As reference:
Some handy tips: SSH Kunfu:
http://blog.tjll.net/ssh-kung-fu/
Or the putty tunnel way:
http://www.howtoforge.com/ssh_key_based_logins_putty_p3
Putty .PPK key to SSH key
1 |
ubuntu sudo apt-get install putty putty-tools |
command line:
1 |
puttygen key.ppk -O private-openssh -o key.ssh |
log onto your system:
1 |
ssh user@server.com -i key.ssh |
Add your key to your linux shell:
1 |
ssh-add /path/key.ssh |
More to come I think 🙂
Share the post "ssh stuff"

startup synergy client before login (xfce)
02/06/2014
Want to start synergy before the login screen?
Create a file in : /usr/local/bin
1 2 3 4 5 |
#!/bin/bash # # START SYNERGY CLIENT # synergyc 192.168.1.33 |
then chmod +x  it.
Add a line to the file in /etc/rc.local just before “exit 0” to execute the script at boot and before the login screen.
Share the post "startup synergy client before login (xfce)"