Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

2013-09-15

Install simple FTP server for OpenElec on Raspberry Pi


Intro


Looking for a quick FTP server to transfer files from the Raspberry Pi running Openelec ?

You can cross-compile vsftpd using a linux computer. It take about 1 hour :
http://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/

or you can download it from here :
https://dl.dropboxusercontent.com/u/2052458/blog/vsftpd_for_rpi.tar.gz


Installation

To install it, simply open a SSH prompt on your pi

go to /storage and create an opt directory

mkdir /storage/opt
cd /storage/opt
wget https://dl.dropboxusercontent.com/u/2052458/blog/vsftpd_for_rpi.tar.gz
tar xvfz vsftpd_for_rpi.tar.gz
rm vsftpd_for_rpi.tar.gz

There is only 2 files, you can edit the vsftpd.conf file if you wish to change some settings

Testing

just go to the vsftpd directory and launch it
cd /storage/opt/vsftpd
./vsftpd vsftpd.conf

let's try a connection :
telnet 127.0.0.1 21
HELO
QUIT

Autostart


check if the file /storage/.config/autostart.sh exists
if not, create it
echo "#!/bin/sh" > /storage/.config/autostart.sh && chmod +x /storage/.config/autostart.sh

now add the lien to start vsftpd :
echo "/storage/opt/vsftpd/vsftpd /storage/opt/vsftpd/vsftpd.conf" >> /storage/.config/autostart.sh

2011-09-27

Reinstall Grub after Windows 7 erased it from the MBR

You just reinstalled Windows on your dual boot computer and it removed Grub, now you can't access to your Linux (Ubuntu in my case)... Here is how to fix that :

Boot on a Linux live CD/DVD or USB Stick

Let's assume my harddisk will be called /dev/sda

Make yourself root :
sudo -s


List your patition to identify the one which contains your Linux system
fdisk -l /dev/sda


Create a folder and mount your Linux on it
mkdir /mnt/mylinux
mount /dev/sda1 /mnt/mylinux (where 1 is the partition number of your linux system I identified before)

Check if you recognize your system :
ls -l /mnt/mylinux

Now we have to bind sys, dev and proc
mount -o bind /dev /mnt/mylinux/dev
mount -o bind /sys /mnt/mylinux/sys
mount -o bind /proc /mnt/mylinux/proc

Chroot to your system by typing
chroot /mnt/mylinux /bin/sh


Reinstall Grub properly
grub-mkconfig > /boot/grub/grub.cfg (menu.lst is you are using old Grub)
grub-install /dev/sda


Done !


Unmount everything and reboot :)
exit
cd /
umount /mnt/mylinux/dev
umount /mnt/mylinux/sys
umount /mnt/mylinux/proc
umount /mnt/mylinux/
sync
reboot

Popular posts