My perfect vacation is hanging out with my friends wherever they may be for long periods of time. My friends are spread out over at least three provinces so this involves more than a little travel. Also, I go to a few festivals with some of them, which makes the time even better, because of the people and atmosphere combined.
I go to music festivals more for the people than the music.
Thursday, August 5, 2010
Wednesday, July 14, 2010
gtkpod on macbook
I can finally use gtkpod on my MacBook laptop, though it is not completely painless. This may be the last item that was keeping the Linux laptop around.
This was done by running gtkpod on Debian in a virtual machine running in VirtualBox, the ipod file system was attached with sshfs, and the destination where I copied the music to was also attached using sshfs.
First I made sure I could SSH into the MacBook, this was done a while ago and I can't exactly remember how to turn on the SSH server.
Then I installed VirtualBox.
Next I installed a basic Debian instance, and installed the openssh-server, sshfs, and gtkpod packages.
I ssh into the virtual machine with the -X option to enable X11 forwarding, make sure iTunes is not running, mount the iPod file system over sshfs, and launch gtkpod. At this point gtkpod is on the screen.
This was done by running gtkpod on Debian in a virtual machine running in VirtualBox, the ipod file system was attached with sshfs, and the destination where I copied the music to was also attached using sshfs.
First I made sure I could SSH into the MacBook, this was done a while ago and I can't exactly remember how to turn on the SSH server.
Then I installed VirtualBox.
Next I installed a basic Debian instance, and installed the openssh-server, sshfs, and gtkpod packages.
I ssh into the virtual machine with the -X option to enable X11 forwarding, make sure iTunes is not running, mount the iPod file system over sshfs, and launch gtkpod. At this point gtkpod is on the screen.
Monday, July 5, 2010
server from laptop, round three
I re-started the building of the home server from the broken laptop, using Debian Lenny this time. After a basic install, I have added openssh-server and avahi-daemon to allow for remote access.
Samba will follow shortly.
Samba will follow shortly.
Sunday, July 4, 2010
Push API vs Pull API
I have found that Pull APIs are much harder to implement than Push APIs, but often the Pull API is much easier to use.
First I shall show an example of each, suppose I want an API for generating the numbers from 1 to 100.
As a Pull API I get the following.
The push version is smaller, and in some ways simpler, but the control is inverted so it is not as versatile.
For example, only the pull version can be used to do a side by side comparison of the range generator results, since two of them would be iterating at the same time.
It is also trivial to turn a Pull API into a Push API, by just looping over the result generator and calling back to the visitor.
I have found that the complexity of changing a Push API into a Pull API is braking up the algorithm at the result emitting step, which often requires it to be re-worked as a state-machine. This is especially challenging where the algorithm is recursive.
First I shall show an example of each, suppose I want an API for generating the numbers from 1 to 100.
As a Pull API I get the following.
public class RangePull {
private int i;
public RangePull() {
i = 1;
}
public boolean hasNext() {
return i <= 100;
}
public Integer next() {
int out = i;
i++;
return out;
}
public static void main(String[] args) {
RangePull r = new RangePull();
while (r.hasNext()) {
Integer i = r.next();
// do something with i
System.out.println(i);
}
}
}
as a Push API I get the following.
public class RangePush {
public interface Visitor {
void accept(int i);
}
public void visit(Visitor v) {
for (int i = 1; i <= 100; i++) {
v.accept(i);
}
}
public static void main(String[] args) {
RangePush r = new RangePush();
r.visit(new Visitor() {
@Override
public void accept(int i) {
// do something with i
System.out.println(i);
}
});
}
}
The push version is smaller, and in some ways simpler, but the control is inverted so it is not as versatile.
For example, only the pull version can be used to do a side by side comparison of the range generator results, since two of them would be iterating at the same time.
It is also trivial to turn a Pull API into a Push API, by just looping over the result generator and calling back to the visitor.
I have found that the complexity of changing a Push API into a Pull API is braking up the algorithm at the result emitting step, which often requires it to be re-worked as a state-machine. This is especially challenging where the algorithm is recursive.
Friday, July 2, 2010
scanner buttons (introduction)
I am lazy when it comes to usage of my scanner, it has buttons on the front, and I expect to be able to scan using those buttons without having the screen on the computer disrupted. This is not the case on my Mac, but is the configuration I have on my Linux laptop. I have also recently found VirtualBox to work nicely enough to play with, so I may be able to set up the scanner in Linux in a box on the Mac.
So far I installed scanbuttond, and see that the scanner is detected and button presses detected.
Later I will look up the rest of the configuration and return to this mini-project.
So far I installed scanbuttond, and see that the scanner is detected and button presses detected.
apt-get install scanbuttond
Later I will look up the rest of the configuration and return to this mini-project.
Tuesday, June 8, 2010
coffee pancakes
I tried instant coffee in my pancakes this morning, I just made it part of the dry part.
The batter was brown, and after topping with molasses I couldn't even taste the coffee.
I think it worked well enough, though I do not know if it worked for the wake up effect.
The batter was brown, and after topping with molasses I couldn't even taste the coffee.
I think it worked well enough, though I do not know if it worked for the wake up effect.
Sunday, June 6, 2010
server from laptop, round two
I got gifted a larger hard drive for the laptop based home server, 160 GB, the original disk is 40 GB.
I decided to do a fresh install using the newest ubuntu-desktop (ubuntu-alternate) distribution, 10.04, and have encountered some challenges.
After the first install the hard disk would not boot, which I found was due to a bad block, so I eventually figured out how to create the file system on the disk myself and verify the disk in the process.
After the second install the system froze when the graphical display came up, so far I have found how to boot into a rescue mode with a text prompt, from which I installed openssh-server, and successfully logged into the server.
At this point it is time to leave it for the night and sleep, next I shall figure out how to disable the graphical display.
The easiest option would seem to be installing ubuntu-server instead, but I wish to serve graphical desktops from this server as well.
I decided to do a fresh install using the newest ubuntu-desktop (ubuntu-alternate) distribution, 10.04, and have encountered some challenges.
After the first install the hard disk would not boot, which I found was due to a bad block, so I eventually figured out how to create the file system on the disk myself and verify the disk in the process.
After the second install the system froze when the graphical display came up, so far I have found how to boot into a rescue mode with a text prompt, from which I installed openssh-server, and successfully logged into the server.
At this point it is time to leave it for the night and sleep, next I shall figure out how to disable the graphical display.
The easiest option would seem to be installing ubuntu-server instead, but I wish to serve graphical desktops from this server as well.
Subscribe to:
Posts (Atom)