[GUIDE] Hosting A Live Wordpress Site On A Raspberry Pi Zero - Hardware Hacking General

How to host a WordPress website from home on a Raspberry Pi Zero.
You will need:
-A Raspberry Pi
-A wireless adaptor
-A bit of time
This guide assumes you already have Raspbian running on your Pi.
All commands can be run over ssh but you will need to VNC into it
a bit later. So you could also do all of it through VNC if you wish.
WARNING:
This is a fun little project but it's not advised to run a website
from your home network. If you miss-configure something or don't keep
things updated on your Pi the risk is greater than if you use a
web hosting service because if your Pi gets compromised, the attacker
now has a full Linux distro already authenticated on your network.
The risk of this actually happening is about as low as getting mugged.
It's not likely but...better safe than sorry.
Now for the good bit:
Ssh to your Pi, change the default password to a strong one and lets get started:
Install apache2:
$ sudo apt-get install apache2 -y
$ sudo apt-get install apache2-util
install mysql and php:
$ sudo apt-get install mysql-server php5-mysql -y
(mysql will prompt you for setup)
Restart apache:
$ sudo service apache2 restart
Move to this directory:
$ cd /var/www/
create a new folder:
$ sudo mkdir wordpress
Move to the new directory:
$ cd wordpress
Get wordpress:
$ sudo wget http://wordpress.org/latest.tar.gz
Extract wordpress:
$ sudo tar xzf latest.tar.gz
Move the contents of the wordpress folder to the current directory:
$ sudo mv wordpress/* .
Delete the now empty folder and the tar:
$ sudo rm -rf wordpress latest.tar.gz
Set perms:
$ sudo chown -R www-data: .
Create a database:
$ mysql -uroot -p (this assumes username is root and will prompt for password)
$ create database WordPress;
Forward port 80 to your Pi:
There is no 'one way' to do this. it depends on what router you have.
If you don't know how to do it, use Youtube and Google to find out how.
What you want to do though is forward port 80 to your Pi's LAN adress.
(the adress you used to ssh to the Pi).
Note: Some internet service providers block traffic on port 80 by
default so you may need to use different ones. If thats the case you might
also need to setup apache differently.
Get a domain name:
Go to a freedns site(https://freedns.afraid.org/) and register a subdomain to
your Pi's EXTERNAL IP adress. You can find your external address by visiting
'whatismyip.com' however this requires a screen so you will have to enable VNC
on your Pi by typing '$ sudo raspi-config' and going to the 'advanced' menu.
You then need a VNC viewer on the computer you are setting this up from. So type
'$ sudo apt-get install xtightvncviewer' then connect to you Pi by typing
'$ vncviewer the.Pi.lan.ip:5901'.
Next we need to point apache to the right directory for Wordpress because
you may have noticed that at the moment your subdomain just takes you
to the apache startup page.
$ sudo nano /etc/apache2/sites-enabled/000-default.conf
This will open a config file. Make sure the directory listing in there
is pointing to your Wordpress directory and add your site alias within
the virtual host tags. It should look something like this:
<VirtualHost *:80>
# blah blah blah
# blah blah blah
# blah blah blah
ServerAdmin [email protected]
DocumentRoot /var/www/wordpress
ServerAlias yoursubdomain.here.com
#My changes
<Directory "/var/www/wordpress">
AllowOverride All
</Directory>
# blah blah blah
# blah blah blah
# blah blah blah
/VirtualHost>
press ctrl+o to save it. Hit enter to confirm then exit by
pressing ctrl+x
Now we need to install Wordpress.
In a browser type you Pi's LAN IP address and Wordpress will guide you
through the installation and setup.
(leave the database host as localhost when prompted)
Now we need to change the URLs in the database we created to
the URL of our subdomain.
For this you need to install PHPmyadmin:
$ sudo apt-get install phpmyadmin
You will be prompted to configure it and you will need to put
database username and password in.
The installation process actually adds the phpMyAdmin Apache
configuration file into the /etc/apache2/conf-enabled/ directory,
where it is automatically read.
The only thing we need to do is explicitly enable the php5-mcrypt
extension, which we can do by typing:
$ sudo php5enmod mcrypt
Afterwards, you'll need to restart Apache for your changes to be recognized:
$ sudo service apache2 restart
You can now access the web interface by visiting:
http://localhost/phpmyadmin (through vncviewer) or
http://lan_ip_of_Pi/phpmyadmin(from another machine on the network)
From here, once logged in, you should be able to see a collapsed directory
tree on the left side of the page. One of the databases listed here
should be named 'wordpress'. expand it by pressing the '+' then
click on 'wp_options'. Now in the main window you should see a
table with various entries. The ones we are interested in are
the ones named 'siteurl' and 'home'. Click the edit button to the
left of them and change the value of both of them to:
'http://YOUR_DOMAIN_HERE.com.'
Now there is just one last place to change the URLs.
In the browser of a machine on the same network as your Pi go to the
LAN IP of your Pi adding '/wp-admin' at the end. Log in with the
details you supplied during the setup. At the top of the page you will
now see an admin toolbar. Hover over the icon that looks like a dial
and click on 'dashboard'. When it loads the side bar, scroll down to
'settings' and select 'general'. Here you change 'Wordpress address URL'
and 'site address URL' to your shiny new domain name.
Voila! You should now have a live to the world Wordpress site
running off a cheap home server, with no hosting costs.
This guide 'should' get you all the way to a live site but there
is a chance that extra configuration is needed or that I forgot
something.
Similar steps can be used for all kinds of different servers. If You just want to serve files straight from an apache index style page you can follow this guide, missing out the wordpress stuff and leaving your apache configs alone. Implementing htaccess you can also password protect your files or a folder. If you do this I highly recommend not adding a directory listing for the folder that is 'private'. even if it is password protected.
Enjoy!!

Related

[GUIDE] Lazyman's installation guide to ADB on Ubuntu 10.10 - Now with Ubuntu 11.10 !

I've been searching around the forums,the stickies and Google on how to install ADB in Ubuntu from scratch but I wasn't able to get a guide anywhere. What I found mostly are for Windows or little bits and pieces of info which did not cover the whole thing. Which is when I decided to grab some Tab and Mountain Dew, and Google my way through to make it work and share it to those who had trouble or no idea how to install it on Ubuntu.
When I'm writing this, I'm using Ubuntu 10.10 64bit to install and run everything. I will update the guide periodically for updates and other things. There was mentions of using Eclipse SDK while searching around, but I won't be touching on that. There's another guide for it at the end of my guide. I have yet to encounter any problems while using ADB in 64bit environment. I've tested it out on the 32bit platform as well and it works. It'll also work on SD and NAND versions of Android for the HD2, since it's my main phone. Also, this is my first time making a guide, so bear with me if there's any mistakes. I've checked the article a few times hoping that it's clear and easy to understand. From
Steps 1 to 4 and Steps 6 and 7, there's no differences in installation instructions for Ubuntu 11.04. You do have to take special note in Step 5 and the key difference of ADB working for your device in Ubuntu 11.04 is found here.
For Ubuntu 11.10, you can see the guide here. Credit goes to loveubuntu for making it.
Step 1. Install JDK
You'll need to install JDK for ADB to work. If you have already installed JDK, I recommend reinstalling it again, just in case there are new updates or you have the older version.
In Terminal, do the following
Code:
$ sudo add-apt-repository ppa:sun-java-community-team/sun-java6
$ sudo apt-get update
$ sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk
Edit: If you're getting a "404 Not Found" when trying to install java in Ubuntu 11.04, this link here will give you a quick fix.
Edit: If you want or need to use Eclipse, here's a simple installation command
Code:
$ sudo apt-get install eclipse ruby rubygems ruby-dev libxml2 libxml2-dev libxslt-dev openjdk-6-jdk ant git
$ sudo gem install nokogiri
Step 2. Download and Install Android SDK
Download the Android SDK. Obviously, choose the one for linux (android-sdk_rXX-linux_86.tgz), where "rXX" is the latest version.
Code:
http://developer.android.com/sdk/index.html
Extract the android-sdk-linux_x86 folder from android-sdk_rXX-linux_x86.tgz. Just double click the tgz file, and drag-n-drop the that lone folder to your desired location. In my case, I extracted the files to my Home Folder, which I highly recommend. I'll also advice to not renaming the folder.
Step 3. Choose packages to install
In Terminal, type the following -
Code:
$ cd ~/android-sdk-linux_x86/tools
$ ./android update sdk
The 'Android SDK and AVD Manager' window will appear (screencap below). You can choose to accept all of them or just install all except for Android 1.5 and 1.6. Once installation is finished, it will prompt you to restart the manager. Just click 'Yes' and close the manager
Step 4. Check your device's permission
Now head over to the platform-tools directory
Code:
$ cd ~/android-sdk-linux_x86/platform-tools
Check if you have permission for your device
Code:
$ ./adb devices
If you're getting the following, go on to Step 5.
Code:
List of devices attached
???????????? no permissions
If you're getting something like this or other random numbers with the word device next to it, congrats! You now could use ADB. Now go on to Step 7.
Code:
List of devices attached
0123456789ABCDEF device
Step 5. Giving permission to your device
You'll need to create a certain udev rule. First off type the following in Terminal:
Code:
$ sudo gedit /etc/udev/rules.d/99-android.rules
For those using Ubuntu 10.10, use the following! For Ubuntu 11.04 users, please scroll down a little for 11.04 guide.
Ubuntu 10.10
Once the gedit window pops-up, type the following line.
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
Take note of ATTRS{idVendor}=="####". Replace #### to the correct Vendor ID of your device. If you're using Acer, then it's 0502, for HTC it's 0bb4. ADB might not be able to detect your device if you use the wrong ID. Here's a list of each vendor's ID. Source: http://developer.android.com/guide/developing/device.html
Code:
Manufacturer USB Vendor ID
Acer -0502
Dell -413c
Foxconn -0489
Garmin-Asus -091E
HTC -0bb4
Huawei -12d1
Kyocera -0482
LG -1004
Motorola -22b8
Nvidia -0955
Pantech -10A9
Samsung -04e8
Sharp -04dd
Sony Ericsson -0fce
ZTE -19D2
Save the file and exit out of gedit. Back in Terminal execute the following
Code:
$ sudo chmod a+rx /etc/udev/rules.d/99-android.rules
$ sudo restart udev
For Ubuntu 11.04. Special thanks to mmdl1001 for figuring this one out! Would've posted it earlier Ubuntu 11.04 was a little nasty on my PC for me to test it out. VMWare saved me though...
For Ubuntu 11.04 users, you'll need an 8 digit number, which is slightly different from Ubuntu 10.10. Copy and paste the following code in the 99-android.rules file you created
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
TEST=="/var/run/ConsoleKit/database", \
RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"
Next, you'll need to find the digits to replace "####:####' above. In terminal type
Code:
$ lsusb
You should be getting a list like so. Note that what is generated in your PC will be much different from mine below!
Code:
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 046d:c019 Logitech, Inc. Optical Tilt Wheel Mouse
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 010: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 007: ID 22b8:2d66 Motorola PCS
Look for your device. It's easily identifiable via its brand . In this case, "Bus 001 Device 007: ID 22b8:2d66 Motorola PCS" is for my device. Copy the ID numbers, 22b8:2d66 for my case, and replace the ####:#### in the 99-android.rules file. Save the file and close gedit and execute the following in Terminal.
Code:
$ sudo service udev restart
Now to check if it works
Code:
$ ./adb devices
You should be getting the following line or something similar.
Code:
List of devices attached
0123456789ABCDEF device
Congrats! Now you can use ADB in Ubuntu! Now hop on to Step 6!
If that fails and still give you "???????????? no permissions", try restarting the adb server. That should do the trick. If that still doesn't work, check the file, 99-android.rules, that you created earlier. Most likely you have put in the wrong Vendor ID.
Code:
$ sudo adb kill-server
$ sudo nohup adb start-server
Step 6. Now to have fun!
Head down to Captainkrtek's ADB Workshop and Guide for everyone to learn how to use ADB. Take note that while using adb in Linux, you'll need to type ./adb to execute adb unless you create a path in bashrc. Go to Step 7 for that . For now, here are some examples on running adb if you don't create a path.
To get into the phone
Code:
[email protected]~/android-sdk-linux_x86/platform-tools:~$ ./adb shell
To grab files from phone
Code:
[email protected]~/android-sdk-linux_x86/platform-tools:~$ ./adb pull /system/etc/file.txt file.txt
To send file to phone
Code:
[email protected]lelune-~/android-sdk-linux_x86/platform-tools:~$ ./adb push this.txt /sdcard/this.txt
Also, do take note that when you pull a file, it will save itself in your android-sdk-linux_86 folder if no destination folder was given.
Step 7. Create path for ADB
Code:
$ sudo gedit ~/.bashrc
Add the following line at the very end of the file. Once you're done, save and exit.
Code:
# Android tools
export PATH=${PATH}:~/android-sdk-linux_x86/tools
export PATH=${PATH}:~/android-sdk-linux_x86/platform-tools
Now you can just run adb like it's a command.
Edit: Okay, for some odd reason, while the above worked for my desktop, it failed when I tried it on my notebook. If you tried to create a path but it failed, here's an alternative method
Code:
$ gedit ~/.profile
Once the gedit window pops up, scroll down to the very bottom of the file and add this line
Code:
[...]
PATH="$HOME/android-sdk-linux_x86/tools:$HOME/android-sdk-linux_x86/platform-tools:$PATH"
Once you've saved and closed gedit, run the following command in Terminal
Code:
export PATH="$HOME/android-sdk-linux_x86/tools:$HOME/android-sdk-linux_x86/platform-tools:$PATH"
And that's about it. Feel free to comment, give suggestions or ask questions if you're still unsure.
Also for more in-depth guide, try HowtoForge. Just found this guide today and I find it VERY useful and even have a good guide on Eclipse.
Took me about 10 mins to get this going. Thank you very much!
I have a guide to setup up a build enviroment for compiling android on a ubuntu 10.10 64bit or 32bit that covers adb also along with test signing. Just google guide to compiling android, covers cm7 and you will find it. It might be under gridlock32404 which was my old user name
Sent from my HTC Vision using XDA App
ffffffffuuuuuuuu where was this last year? took me 2 days to get ADB working in Ubuntu 10.04 lol.
i do have the Ubuntu 10.10 ISO image...thinking about dual booting with win7 64bit.
not sure why i want to go back to Linux though...games ran slower on it =/
Amazing work man. It works like a charm with my milestone.
nice tutorial but it would be even nicer to have a .deb; I never made debs before but I think this should all be doable with rpm though, so I guess it should also be doable with debs
(eg with a postinstall script update udev rules, using sed, restart abd and add a .desktop file)
saved a lot of do it myself
i was about to do this thank you for doing it first nice
I get following error when i try to refresh sources.
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: java.lang.RuntimeException: error instantiating default socket factory: java.security.KeyManagementException: java.security.KeyStoreException: java.io.FileNotFoundException: /usr/lib/jvm/java-1.5.0-gcj-4.4/jre/lib/security/cacerts (No such file or directory)
Click to expand...
Click to collapse
Edit:- I installed all packages like openjdk, openjre, icedtea etc and i was able to connect to google repo.
thanks Im installed
atapia984 said:
Took me about 10 mins to get this going. Thank you very much!
Click to expand...
Click to collapse
You're welcome! Honestly, it took me about 2 to 3 hours to get it running.
godutch said:
nice tutorial but it would be even nicer to have a .deb; I never made debs before but I think this should all be doable with rpm though, so I guess it should also be doable with debs
(eg with a postinstall script update udev rules, using sed, restart abd and add a .desktop file)
Click to expand...
Click to collapse
Personally, I don't think a .deb file is required. Almost everything can be found in the repository anyways and it's quite easy to set up using terminal, and uh, I never really made debs before either
thank u very muchhhhhhhhhhhhhhhhhhhhhhh, ADB was big problem with me .
thanks again.
sdk now says "x86"
I'm not sure if anyone else had this problem, but I was foolishly copying and pasting the commands over from the OP and it didn't work.
However, when I realized that the SDK package is now titled "android-sdk-linux_x86" with that tiny little "x" before the "86", I got it to work flawlessly.
Now my Ubuntu ADB installation works easier than my Windows ADB!
could someone tell me if you can run movie after you run ubuntu on your PDA
expeciali .mkv video...
please ansevar me...
strikeir13 said:
I'm not sure if anyone else had this problem, but I was foolishly copying and pasting the commands over from the OP and it didn't work.
However, when I realized that the SDK package is now titled "android-sdk-linux_x86" with that tiny little "x" before the "86", I got it to work flawlessly.
Now my Ubuntu ADB installation works easier than my Windows ADB!
Click to expand...
Click to collapse
Thanks for the heads up! I've updated the guide accordingly. Looks like they've changed the name with revision 10
Cool write up. definitely bookmarked.
only because i want to compare it to the method i used to get it running earlier. There are a lot of extra steps it looks like with this method that i didn't do earlier.
Thanks. First method to add to path didn't work, but second did finely.
very nice, thank you. Only three hints that helped me get everything working perfectly:
1- Assume you have no permission and create the udev rule step. In that same step when typing
Code:
./adb devices
to see if it worked, make sure you cd to the right directory. You have to be in
Code:
cd ~/android-sdk-linux_x86/platform-tools
.
2- In step 7 creating paths, eliminate the space between {PATH}: and ~/android. If left that way, the terminal gives you a not valid identifier error.
3- The Howtoforgelink at the bottom is very nice also but note that they are using an older SDK and file name has to be changed if you want the latest (add the x).
I hate the fact that most guides out there for a Linux based OS (Android) is written for Windows. Quite ironic. Thanks again for your hard work.
loveubuntu said:
very nice, thank you. Only three hints that helped me get everything working perfectly:
1- Assume you have no permission and create the udev rule step. In that same step when typing
Code:
./adb devices
to see if it worked, make sure you cd to the right directory. You have to be in
Code:
cd ~/android-sdk-linux_x86/platform-tools
.
2- In step 7 creating paths, eliminate the space between {PATH}: and ~/android. If left that way, the terminal gives you a not valid identifier error.
3- The Howtoforgelink at the bottom is very nice also but note that they are using an older SDK and file name has to be changed if you want the latest (add the x).
I hate the fact that most guides out there for a Linux based OS (Android) is written for Windows. Quite ironic. Thanks again for your hard work.
Click to expand...
Click to collapse
Thanks, I'm gonna try it out on my notebook when I get a chance on Monday. Left it at my workplace. Hopefully, that little space is the reason why the path didn't work on my notebook .
As for the HowtoForge guide link, I wasn't able to find a more updated version for it. It'll be great if they update that guide as well though.
It really is kind of sad, and ironic, that Windows is dominating even on a Linux based OS which is Android. But after playing around with both Windows and Ubuntu for ADB, I personally find ADB on Ubuntu is much more easier (and a bit more stable) to handle. Maybe it's because I usually work with command line on Linux and more on GUI on Windows.
I came across this thread on DF also that seems to be very helpful. CorCor67 put a lot of time into it.
http://www.droidforums.net/forum/droid-themes/129400-themer-studio.html
I cross referenced both threads for those looking
Anybody know howto - about fastboot.exe I mean I have done all the steps ahead and have adb installed but cant figure out how to install fastboot in platform-tools directory.
I reinstalled it again but there is no fastboot.exe it hadn`t appeared in platform-tools. 3 month`s ago I did it just like that and it installed fastboot automagically but this time I just don`t now what to do and where to dig. Not able to flash radio at the moment.
Ubuntu 10.04
Desire HD

[WebTop] - [HowTo] - Setup WebTop environment with AfterStep as a window manager

Setting up WebTop environment
Prerequisites
You have to have your phone rooted and SU installed. There are number of exploits and tools available depending on the phone.
Naturally you should already have either Motorola HD Multimedia Dock or whatever webtop capable dock comes with your phone. Good idea to plug it into hdmi capable display and have keyboard+mouse attached to it.​
webtop2sd
It is recommended that you do not modify the WebTop environment in phone's own flash, but instead create a partition on SD card and use webtop2sd utility to copy phone's WebTop. webtop2sd will then mount this partition ontop of the phone's own stuff and if it get's screwed up you'll be able to go back to the blank slate and use your phone's WebTop again.
Get webtop2sd and instructions here.
In my experience running webtop configurator to install lxterminal did not work the first time. I had to reboot the phone one more time, and upon running webtop configurator again - lxterminal installed fine.​
webtopscripts
Package management is horribly broken in webtop due to manufacturers doing weird things to it, and possibly breaking it on purpose. To fix stuff, so that apt-get works again - use webtopscripts. Download from Google Code and follow the instructions. Setup script walks through all of the fixes - there is no need to run individual scripts.
After this you get Ubuntu Jaunty in more or less usable state. Time to install packages and tweak.​
Basic tweaks
The first thing you want to do is disable (or possibly re-configure) xscreensaver. By default it will show nasty looking day-glo colored waves on the screen in colors that hurt eyes like acid. Open LXTerminal - (there should be a button for it on the dock at the bottom of the screen) and run:
Code:
kill $(ps -ef | grep 5000 | grep xscreensaver | cut -c10-15).
Another good thing to kill is webtop-wallpaper. Its a desktop window layered underneath everything else and displaying wallpaper and maybe icons? Anyway this stuff is bad. Kill it:
Code:
kill $(ps -ef | grep 5000 | grep webtop-wallpaper | cut -c10-15)
This changes have effect only temporarily until webtop shuts down, which is either when phone runs out of memory and garbadge collection kicks in or when it's powered off. Note that undocking the phone preserves your session!
For more permanent solution - we need to edit startup scripts, but first we need something to edit those with - my personal low tech favorite - nano:
Code:
sudo apt-get install nano
Also useful the text-mode file manager Midnight Commander :
Code:
sudo apt-get install mc
Both nano and mc are great in large measure because they don't depend on other packages.
Now we can edit the config files:
Code:
sudo nano /osh/usr/local/bin/start-oshwt-1.sh
and comment out xscreensaver line.
Unfortunately as Webtop is using older version of Ubuntu - it runs circa 2009 version of gnome-settings-daemon, which automatically starts xscreensaver with no way to stop this behavior. The only way is to comment out gnome-settings-daemon out of start-oshwt-1.sh, but that will also disable webtop-panel, which is still useful for us until we get AfterStep up and running. Meanwhile use the kill code from above.
Code:
sudo nano /osh/usr/local/bin/start-oshwt-2.sh
and comment out webtop-walpaper line.​
With annoyances taken care of we can now start with with the useful stuff.
Getting the AfterStep
AfterStep package in Jaunty is old and broken in webtop environment, therefore it is recommended to install AfterStep from the source code. Naturally we need some tools :
Code:
sudo apt-get install cvs
sudo apt-get install openssh-client
Strictly speaking ssh client is not required unless you want write access to CVS repository, but it's still useful to have around. Checkout AfterStep sources :
Code:
cvs -d :pserver:[email protected]:/home/cvsroot login
cvs -d :pserver:[email protected]:/home/cvsroot co afterstep-stable
Note: Just hit Enter when prompted for login password​
Compilation
Prerequisites
Naturally, to be able to compile AfterStep we need the compiler :
Code:
sudo apt-get install gcc
That will install gcc 4.3 and binutils. Suggested packages : gcc-multilib, manpages-dev, autoconf, libtool, and if you want to do some debugging - gdb.
Code:
sudo apt-get install autoconf
Also installs automake, autotools-dev and m4.
Code:
sudo apt-get install libtool
Also for some reason compilation won't work without floating point library:
Code:
sudo apt-get install libmpfr-dev
Useful libraries for AfterStep:
Code:
sudo apt-get install libfreetype6-dev
sudo apt-get install zlib1g-dev
Naturally, we need Xorg devel libraries :
Code:
sudo apt-get install xorg-dev
More useful stuff (Optional):
Code:
sudo apt-get install x11-utils
sudo apt-get install nedit
MS Core Fonts, so that you can use Helvetica, Courier, Times, etc. fonts (Optional):
Code:
sudo apt-get install ttf-mscorefonts-installer
Compilation
The actual compilation step should be quite painless:
Code:
cd afterstep-stable
./configure
make
sudo make install
At this point you should have AfterStep installed in /usr/local/bin (binaries) and /usr/local/share/afterstep (data files). Now we need to setup the system to make good use of it.​
System Configuration
Files to change :
/etc/xdg/lxsession/LXDE/config : Replace window_manager line with : window_manager=afterstep -l /home/adas/afterstep.log
/etc/xdg/lxsession/LXDE/default : Comment out xscreensaver, openbox and lxpanel lines.
/usr/local/bin/start-oshwt-1.sh : Comment out gnome-settings-daemon and xscreensaver lines. Apparently fcitx does not work anyway - not sure why they have it in there.
/usr/local/bin/start-oshwt-2.sh : Comment out awn-autostart, webtop-panel, window_switcher and avahi_start lines Note: You can always re-enable webtop-panel, just make sure you start gnome-settings-daemon first. See screensaver notes above.
AfterStep configuration
Copy autoexec file to your home .afterstep dir:
Code:
cp /usr/local/share/aftertep/autoexec ~/.afterstep/
And comment out WorkstateSpace line, as it may trigger duplicate aiw windows and some other weird things due to the way Webtop organizes its X session.​
Finally
Reboot.
At this point you should be all set. Pull the phone out of the dock and reboot it. Put it back in and you should have AfterStep desktop in a few seconds.
If you happened to break things and Webtop don't start - you should be able to recover by double checking or reversing above changes in config files. The files are located under /osh mount point when viewd using Root Explorer on the phone itself.​

Guide for Compiling a kernel for the Tubuntu app by x3maniac and TF101

Guide for Compiling a kernel for use with the Tubuntu application by x3maniac and TF101.
These insturctions work with 64bit Linux laptop/PC's, version 4.5.4 for the armhf toolchain, and 2.6.36 kernel version. The toolchain and kernel from the github below is the direct source x3maniac makes the kernels we are currently using. Please understand a few things, if you add modules to this build you will need to add them to your Linux image you are using. I'll provide specifics as I work through the learning process as well. If you change compilers or upgrade the software components outside of this guide it may produce errors or problems.
If you are looking for making a version 3 kernel, hardware acceleration with nvidia and things like that you will either have to ask x3maniac or do your own research as this guide does NOT tell you how to do this.
******My directories reference my own username on my laptop, please substitute "thomas" with your username OR your /home directory, or whichever directories you wish to use. I used full paths on purpose for my own learning and to be specific for newcomers to Linux who wish to learn to compile.******
All credit goes to the time and consideration x3maniac took to assist me with doing this!
OP for Tubutnu by x3maniac
1. Open Terminal. Everything will be executed from Terminal.
2. Now type: sudo apt-get abootimg
3. Now type: mkdir /home/thomas/kernelbuild
3a. Now type: cd /home/thomas/kernelbuild
4. Now type: git clone https://github.com/novaspirit/tf101-linux-2.6.36
5. Now type: git clone https://github.com/novaspirit/Ubuntu_initrd-3.x.git
6. Now type: git clone https://github.com/novaspirit/config.git
6a. The config.git has a file called /config/boot.cfg, you could modify the last line called the command line and have it boot from alternate locations, the default is fine and set to /dev/mmcblk0p8. So let's not touch it, you can use nano to edit this file.
7. Now type: git clone https://github.com/novaspirit/android-toolchain-4.5.4.git
8. Now type: cd /home/thomas/kernelbuild/tf101-linux-2.6.36
9. Copy this into Terminal and hit enter: sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
10. Copy this into Terminal and hit enter: sudo apt-get install libgtk2.0-dev libglib2.0-dev libglade2-dev (this allows you to make a GUI of the config file)
11. Now type: make help (you should see a list of build targets. You are looking to see if you have tf101_gnulinux_defconf.)
12. Now type: export ARCH=arm
13. Now type: export CROSS_COMPILE=/home/thomas/kernelbuild/android-toolchain-4.5.4/bin/arm-eabi- (understand the arm-eabi- simply ends with the hypen to include sub components, it's not a typo)
14. Now type: make tf101_gnulinux_defconfig
15. Now type: make gconfig (the GUI pops up and this is where you can select options). Click on split, the options will be on the left. This is where you can select what you wish to add. For example, web cam and GPS functions. HOWEVER, it does not mean this will work nor is it all perfectly set up. There may be some additional research by YOU the reader to find out what will or won't work with this kernel. (NOTE: you must run make gconfig even if you don't change anything otherwise an error will occur when you run make -j2 modules command).
16. If you have made changes it will ask you to save. Go ahead and save it.
17. Now type: make -j2 zImage (j2 represents jobs that can be run concurrently, determined by the kernel build. This option only works if you have 2 cores and also you can use -j4 if you have a 4 core system and so on.)
18. Now type: make -j2 modules (If the github provided by x3maniac doesn't have a module you need, this is where YOU the reader must research what you need to add and place it in the appropriate location).
19. Now type: make modules_install INSTALL_MOD_PATH=/home/thomas/kernelbuild/Ubuntu_initrd-3.x/
20. Now type: cd /home/thomas/kernelbuild/Ubuntu_initrd-3.x/
21. Now type: find .|cpio -H newc -o | gzip -9 > /home/thomas/kernelbuild/initramfs.img
21b. The output should say something similar to 1111 blocks or 14582 blocks, doesn't matter the number. The number and blocks means it has been made successfully.
22. cd /home/thomas/kernelbuild
23. Now type: abootimg --create kernel.img -f /home/thomas/kernelbuild/config/boot.cfg -r initramfs.img -k /home/thomas/kernelbuild/tf101-linux-2.6.36/arch/arm/boot/zImage
23b. abootimg is very strict and will produce an error here if anything is wrong. You are looking for the output of some files created and you should see a kernel.img file in your directory with an ls command.
24. If you are going to flash the kernel using the Tubuntu application, rename kernel.img to linux.img and flash appropriately from the app.
25. If you are going to create another kernel you need to clean it up before repeating steps 12-24. So proceed to step 26.
26. Now type: cd /home/thomas/kernelbuild/tf101-linux-2.6.36
27. Now type: make clean
28. Now type: make mrproper
29. Delete kernel.img from /home/thomas/kernelbuild/
30. If you aren't modifying additional modules and parameters you can save the created initramfs.img file. Otherwise delete it and run through the steps, doesn't take long to do anyways.
31. Profit.
My guide is complete now. Please read everything thoroughly before diving in. It's not as difficult as it looks. I will make kernels and modify the guide to weed out any errors, typos, or wrong steps. Hope everyone enjoys! I do this as much for myself as the community.
Made some edits for consistency and clarity. Please remember to check the github to determine if X3, our dev, has made any changes possibly requiring you to git clone again. If changes have been made, it is my experience that the easiest way to get the newest is to just delete the directories and git clone again. There is probably a way to do this and only grab the changes but I really haven't looked into that.
Thanks for this, going to see if I can add some stability in there since mine is barely usable.
You should replace /home/thomas/ with $HOME/ instead, that way it won't error out for people that don't use mkdir -p or aren't using a thomas username
Lethe6 said:
Thanks for this, going to see if I can add some stability in there since mine is barely usable.
You should replace /home/thomas/ with $HOME/ instead, that way it won't error out for people that don't use mkdir -p or aren't using a thomas username
Click to expand...
Click to collapse
I thought about that but I specified it in the beginning of the post. The purpose was to not make assumptions on what people using Linux did or did not know. For example I didn't realize ~/ represented the home directory till x3 pointed it out to me.
Since the post had such little traction I left it as is to help me out as well.
*****lol, I didn't specify the directories and why they were named that way. Must have been my other guide. I'll fix it up soon.
I added this comment below into the OP to remove confusion on the directories I used.
******My directories reference my own username on my laptop, please substitute "thomas" with your username OR your /home directory, or whichever directories you wish to use. I used full paths on purpose for my own learning and to be specific for newcomers to Linux who wish to learn to compile.******

Setting up NAS with Auto Backups on the rPi

So I set up the rPi with rdesktop, gedit, ntfs-3g, Samba, Hamachi, Privoxy and rsync to build my NAS and VPN. I have two external hard drives (2 TB and 500 GP) plugged in to a powered USB hub. I also have the powered USB hub powering the rPi. I'll reference the links I used as I go along, this wasn't hard to do.
I'll say it right now, if I can figure it out, anyone can.
First off if you haven't put Rasbian on your rPi, go do it and then come back....you're back already? Great, let's get started.
I don't like having to plug in a monitor, keyboard and mouse every time I want to access my rPi, so go ahead and do it the first time for the setup. Now that you have your peripherals all set up, let's install rdesktop so we don't have to do this again.
Open the terminal and then:
sudo apt-get install rdesktop
then get the IP address and write it down:
ifconfig eth0
Great. Now you can keep working on it as you have it set up or you can access it from another computer. IF you're on linux, go to your terminal and enter:
rdesktop ipaddress from above -g 90% (the -g 90% tells rdesktop to launch at 90% of the size of your screen. If you want something larger or smaller, suit yourself.) Sign in as your user id and password for your rPi.
Since I'm not a big nano fan, I like to use gedit, let's install it now:
sudo apt-get install gedit
Now I initially followed this guide to set up Samba, http://elinux.org/R-Pi_NAS. We'll walk through the relevant parts. Let's install Samba:
sudo apt-get install samba samba-common-bin
If you're prompted to continue then say yes. Copy the the samba config file, in case we mess it up.
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old
On the link above we're told to use nano to update our config file, as I said, I don't like it. The great thing about Linux is, if you don't like something, you don't have to use it. So we won't use it...much.
Let's work on that config file:
sudo gedit /etc/samba/smb.conf
Search for security (ctrl + F and type security, then press enter) and you'll find the following:
# security = user
Go ahead and remove the #, so we just have:
security = user
Now let's search for homes and change:
read only = yes
to
read only = no
Now save and close the file. Run the following command to restart Samba:
sudo /etc/init.d/samba restart
You'll see the following:
Stopping Samba daemons: nmdb smdb
Starting Samba daemons: nmdb smdb
Samba comes configured with your user id defined, assuming it's pi we will now allow pi to be a Samba user.
sudo smbpasswd -a pi
You'll need to enter the password twice and then pi will be setup as the samba user id. If you would like to add an additional user(not required), then do the following:
sudo useradd marty -m -G users
sudo smbpasswd marty
You'll be asked to enter the password for marty twice now.
Now let's make a shared folder to house our main storage (this will be for user pi, not for marty):
sudo mkdir /home/pi/shared
We also need to make a folder to house our backups:
sudo mkdir /home/pi/backup
Once more we need to edit the Samba configuration file, this time we are telling it about the shared folder we just created. So let's go do that:
sudo gedit /etc/samba/smb.conf
Scroll down to the end of the file and add the following:
[public]
comment = Public Storage
path = /home/pi/shared
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no
Now save and close the file. Run the following command to restart Samba:
sudo /etc/init.d/samba restart
You'll see the following:
Stopping Samba daemons: nmdb smdb
Starting Samba daemons: nmdb smdb
Now we are getting ready to start mapping our drives, so let's make sure we have support for NTFS-formatted disks.
sudo apt-get install ntfs-3g
Great, good job!
Let's go find our hard drives that we have mounted so we can get them setup to do their jobs. Run the following command to determine where they are currently located in our file system:
sudo fdisk - l
You'll see something like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now let's look at the results:
/dev/mcblk0 - This is the SD Card that Rasbian is running on.
/dev/sda - This is the 2 TB hard drive that I am using for my main storage.
/dev/sdb - This is the 500 GB hard drive that I am going to use for backing up my family pictures and business documents.
The next step is to mount the hard drives to the folders we created earlier. Before we do this we need to make sure that they are not currently mounted. We are going to do this the easy way, open the file explorer as root:
sudo pcmanfm
and you will probably see the two hard drives mounted, simply client the unmount button beside each one. then close the file manager. Now let's mount the hard drives to their permanet location:
sudo mount /dev/sda1 /home/pi/shared
sudo mount /dev/sdb1 /home/pi/backup
Great job, now we have access from our home folder to both of these drives. But we need to make this happen automatically on boot, easy:
sudo gedit /etc/fstab
Now in the fstab file add the following two lines below the line that starts with /dev/mcblk0p2
/dev/sda1 /home/pi/shared auto noatime 0 0
/dev/sdb1 /home/pi/backup auto noatime 0 0
Make sure you tab where you see the spaces above. Now save and close the file. We are set now, the drives will auto-mount to our home folders when we reboot.
Now it's time to get started with our backups, we need the software first:
sudo apt-get install rsync
(that was hard huh!)
Well we've reached the point where we have to use nano. It's not that hard, but it's definitely different than using a text editor. You will need to use your arrow keys to move up and down and then to save the file you'll need to press 'Ctrl + X' and then you'll be prompted to accept by pressing 'y'. We are now going to configure our backups. I used the guide found on How to Geek, as my inspiration for this, but I've modified a few things to work better for me. I want to give them credit for the idea though. If you read their article they instruct you to setup your backup to run nightly, however I thought that was bit much, so I decided to educate myself and figure out how to modify this. I found this link, which explains how crontab works. Basically crontab takes this entry to determine when it will execute the command that follows:
# Minute Hour Day of Month Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat)
0 2 12 * 0,6 rsync
I wanted to have my backups running at alternating times and only a couple of times a week, so let's go ahead and configure that:
crontab -e
Now you are in nano, navigate down to the bottom of the list and enter the following:
0 2 * * 0,3 rsync -av --delete /home/pi/shares/Pictures /home/pi/backup
0 2 * * 1,5 rsync -av --delete /home/pi/shares/busdocs /home/pi/backup
Now save the file, 'Ctrl + X' and then confirm 'y'. So let me explain what we just set up, I'll go through the first line:
0 - 0 minutes
2 - 2 hours (2 AM)
* - Any day of the month.
* - Any month.
0,3 - Run this on Sunday and Wenesday. (0 - Sunday, 1 - Monday, 2 - Tuesday, etc)
rsync - Command to be ran.
-av - archive and verbose
- -delete - (MAKE sure there are TWO dashes - -, there should not be a space between these.) This parameter tells rsync to delete any file on the to folder that is not on the from folder, so if you remove a file in your main storage it will be removed in you backup.
/home/pi/shares/Pictures - This is the from folder.
/home/pi/backup - This is the to folder.
This last step is optional but recommended. Let's go ahead and run rsync for two reasons, to verify that it can successfully back up your data and to get the biggest backup done.
rsync -av --delete /home/pi/shares/Pictures /home/pi/backup
Depending on how much data you are backing up, this could take a while. When I first ran it I backed up around 40 GB of pictures and it took about 2 1/2 to 3 hours. So go get some coffee and relax.
So your backup is set and ready to run! You did it! And it wasn't even that hard!
There may be a better way to set this up, but this what worked for me, I hope you've enjoyed getting your rPi setup as a NAS with auto backups!
One final piece, setup Hamachi so you can access your files remotely (yes you can already do it if you have SSH installed (which you should.)) Go to logmein.com and create a free account and set up your network. You can install this on Linux, Mac and windoze.
sudo apt-get update
sudo apt-get install --fix-missing lsb lsb-core (this will take a bit)
sudo dpkg -1 --force-architecture --force-depends logmein-hamachi_2.1.0.86-1_armel.deb
( the above line is dash dash force dash architecture and then dash dash force dash depends)
Now set up hamachi on the rPi:
sudo hamachi login
sudo hamachi attach [INSERT LOGMEIN.COM EMAIL HERE]
sudo hamachi set-nick [INSERT A NICKNAME FOR YOUR RASPBERRY PI]
Now back on your computer on logmein.com, go to your networks and grant the Pi permissions to join your network and write down the network ID (a 9-digit number) for that network.
Back on the rPi:
sudo hamachi do-join [THE NETWORK ID YOU WROTE DOWN]
Now start SSH so you can reach the rPi remotely:
sudo /etc/init.d/ssh start
You should test out the set up now by SSH'ing into the rPi at the virtual IP on the logmein.com site, it will be something like 25.xx.xx.xx:
ssh [email protected]
Now you can access your rPi remotely (outside of your network.)
You can also remote desktop into the pi at the new virtual IP address:
rdesktop 25.xx.xx.xx -g 70%
Here are the links that pulled knowledge from for all of this.:
http://www.howtogeek.com/139433/how-to-turn-a-raspberry-pi-into-a-low-power-network-storage-device/
http://linux.about.com/library/cmd/blcmdl1_rsync.htm
http://www.pantz.org/software/cron/croninfo.html
http://elinux.org/R-Pi_NAS
This is what I have planned, but with a twist.
I plan to connect my Seagate Expansion 2TB desktop drive to the rPi. I intend to write a script that will run as a daemon and will check if I have connected my phone to the rPi and if detected, it will backup the images to my drive.
Will share it once successfully implemented. My rPi arrives next week.
Tapatalked from Desire S running Andromadus
suku_patel_22 said:
This is what I have planned, but with a twist.
I plan to connect my Seagate Expansion 2TB desktop drive to the rPi. I intend to write a script that will run as a daemon and will check if I have connected my phone to the rPi and if detected, it will backup the images to my drive.
Will share it once successfully implemented. My rPi arrives next week.
Tapatalked from Desire S running Andromadus
Click to expand...
Click to collapse
That sounds awesome! I would definitely be interested in seeing that!!!

Adding Accounts to Friends(Twitter andFacebook) WORKS

Connect your Ubuntu touch device to you Linux/Windows/Mac Box.
Open up the Terminal/Command Line
type adb root and then adb shell
*On Ubuntu Touch*
Open system setting -> accounts
*on Your Box*
enter one of these
sudo uoa-create twitter <your twitter handle>
sudo uoa-create facebook <your facebook id>
It should prompt a login page for whichever service you have choosen.
Have Fun.
blmvxer said:
Connect your Ubuntu touch device to you Linux/Windows/Mac Box.
Open up the Terminal/Command Line
type adb root and then adb shell
*On Ubuntu Touch*
Open system setting -> accounts
*on Your Box*
enter one of these
sudo uoa-create twitter <your twitter handle>
sudo uoa-create facebook <your facebook id>
It should prompt a login page for whichever service you have choosen.
Have Fun.
Click to expand...
Click to collapse
Nobody ever said anything to this. Wonder if anyone got this working. I didn't. I'll post an image of what I got when entering the command.
With the latest update it works with the settings app.
Update your Ubuntu with the commands: sudo apt-get update && sudo apt-get upgrade

Categories

Resources