Category: Professional
Enda et intervju med meg, denne gangen i Tønsbergs Blad
By Robin Smidsrød on Jun 24, 2010 | In Professional, Personal, Education | Send feedback »
Link: http://tb.no/nyheter/a-i-absolutt-alt-1.5405893
Den lokale avisen, Tønsbergs Blad, var også interessert i prestasjonene mine på skolen. De har publisert et intervju med meg på forsiden av nettutgaven av avisen.
Intervjuet står også i dagens utgave av avisen, 24. juni 2010, og opptar omtrent en halv side.
Jeg ble oppringt av en annen journalist fra Tønsbergs Blad i dag, og de ønsket å intervjue meg til en annen spalte i avisen. Dette intervjuet skal etter sigende komme på trykk i lørdagsutgaven av avisen, 26. juni 2010.
Are you unable to run the JavaME SDK 3.0 emulator on Windows 7? Workaround found!
By Robin Smidsrød on May 8, 2010 | In Software, Professional | 5 feedbacks »
If you get this error message when trying to run midlets through the built-in emulator of the JavaME SDK 3.0, try disabling DEP for runMidlet.exe.
Error message given by Netbeans and/or Eclipse:
*** Error *** Failed to connect to device 0! Reason: Emulator 0 terminated while waiting for it to register!
Data Execution Prevention (DEP) configuration can be found at the following place in Windows: Control Panel > System Security > System > Advanced system Settings > Advanced tab > Performance > Data Execution Prevention.
Add this file to the DEP exclusion list:
<javame-install-dir>\runtimes\cldc-hi-javafx\bin\runMidlet.exe
If things work for you now, complain loudly to Sun (now Oracle) that they need to make software without buffer overflows.
Personally I filed a bug-report against the JavaME SDK 3.0. You should do that too, or make your voice heard on the same bug-report that you're having this problem as well.
How to get a PSGI app running with mod_fastcgi on Ubuntu with Apache2
By Robin Smidsrød on Oct 25, 2009 | In Software, Professional, Perl | 3 feedbacks »
First make sure you activate the multiverse repository for apt.
Then install the required modules (if you don't already have them enabled)
sudo aptitude install libapache2-mod-fastcgi apache2-suexec
Enable the fastcgi and rewrite modules:
sudo a2enmod fastcgi
sudo a2enmod rewrite
Edit /etc/apache2/mods-enabled/fastcgi.conf and enable the FastCgiWrapper so that the .fcgi script is run as the owner of the script. This is why apache2-suexec above is needed.
Then add the following to the file if you like to be able to just touch the psgi.fcgi file to get it to reload your app.
FastCgiConfig -autoUpdate
My /etc/apache2/mods-enabled/fastcgi.conf is like this:
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
FastCgiWrapper /usr/lib/apache2/suexec
FastCgiIpcDir /var/lib/apache2/fastcgi
FastCgiConfig -autoUpdate
</IfModule>
Then you need a small wrapper script to actually run your PSGI app. I call it psgi.fcgi:
#!/usr/bin/perl
use strict;
use warnings;
# For CPAN modules in your home-dir (see local::lib)
use lib "/home/robin/perl5/lib/perl5";
use lib "/home/robin/perl5/lib/perl5/i486-linux-gnu-thread-multi";
use Plack::Server::FCGI;
Plack::Server::FCGI->new->run(do "app.psgi");
The use lib statements are there because I use local::lib. I just grabbed them from the PERL5LIB environment variable. If someone has a better solution on how to write this wrapper with support for local::lib, I'd like to hear it.
The next thing is to add a nice .htaccess file so that you can make flexible apps that use PATH_INFO and other nice things (this is where mod_rewrite comes in).
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ psgi.fcgi/$1 [QSA,L]
Change this one if you'd like Apache to handle static files by itself instead of forwarding the requests to your application.
Finally I just made a small app.psgi that prints the environment as you try out different paths below your base folder. Pay close attention to how PATH_INFO changes as you try it out.
#!/usr/bin/perl
use strict;
use warnings;
sub {
my ($env) = @_;
my @out = ( "Your \$env hash:\n\n" );
foreach my $key ( sort keys %{ $env } ) {
push @out, $key, ' = ', $env->{$key}, "\n";
}
return [
200,
[ 'Content-Type' => 'text/plain' ],
\@out,
];
};
I'm using Plack 0.9006 from CPAN for this little experiment.
I think this will be my quick-and-easy way to deploy PSGI apps from now on.
Update: It seems the suexec wrapper doesn't do its job properly. The FastCGI script, psgi.fcgi, is apparently still running as www-data(33). If you know how to fix this problem please shout out in the comments.
How to setup an Atheros-based Access Point with WPA-PSK on Ubuntu 8.04 server
By Robin Smidsrød on Aug 8, 2008 | In Software, Professional | 4 feedbacks »
Install Ubuntu 8.04 server normally. I haven't tested it, but the desktop edition should also work, but remember to choose the right version of linux-restricted-modules for your setup and to remove the wifi interface from the NetworkManager setup.
Login with your normal "admin" user.
Get access to a root console:
$ sudo -i
Install necessary software (linux-restricted-modules contains the madwifi driver):
# aptitude install linux-restricted-modules-server bridge-utils wireless-tools madwifi-tools hostapd
Change the default wifi mode from sta (station/client) to ap (access point/server):
# echo "options ath_pci autocreate=ap" >>/etc/modprobe.d/options
Change your /etc/network/interfaces to include this instead of the default eth0 setup.
auto eth0 ath0 br0
iface eth0 inet manual
up /sbin/ifconfig eth0 up
down /sbin/ifconfig eth0 down
iface ath0 inet manual
up /sbin/ifconfig ath0 up
down /sbin/ifconfig ath0 down
iface br0 inet static
address <your ip here>
netmask <your netmask here>
gateway <your gateway ip here>
bridge_ports eth0 ath0
Change your ip/netmask/gw on the br0 interface as needed or use dhcp if you have it. The eth0 and ath0 interfaces are not supposed to have IP addresses assigned.
Make a backup of the original /etc/hostapd/hostapd.conf
(it contains some useful documentation, after all):
# mv /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf.bak
Create a new /etc/hostapd/hostapd.conf file with this content:
driver=madwifi
interface=ath0
bridge=br0
hw_mode=a
ssid=<your SSID here>
wpa=3
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
wpa_passphrase=<your wifi password here>
Set the hw_mode to a, b or g depending on your hardware and preferred 802.11 mode.
Lets secure this file as it contains a password in cleartext.
# chown root:root /etc/hostapd/hostapd.conf
# chmod 0600 /etc/hostapd/hostapd.conf
Change the RUN_DAEMON="no" parameter in /etc/default/hostapd to yes. It might also be wise to uncomment the debug options at the bottom of the file until you feel comfortable with the hostapd setup.
Reboot the machine and everything should work automatically.
If you don't want to reboot, it's possible to restart the services manually. Be aware that this is probably somewhat tricky if your logged on with ssh through eth0, so better do it from a local console.
- shut down hostapd (/etc/init.d/hostapd stop)
- shut down network (/etc/init.d/network stop)
- remove ath_pci module (rmmod ath_pci)
- load ath_pci module (modprobe ath_pci)
- start network (/etc/init.d/network start)
- start hostapd (/etc/init.d/hostapd start)
You should now be able to connect any wireless unit that understands WPA using the specified SSID and password. Your syslog should log a line similar to this when a unit connects correctly:
hostapd: ath0: STA <unit-mac-address> IEEE 802.11: associated
hostapd: ath0: STA <unit-mac-address> WPA: pairwise key handshake completed (RSN)
hostapd: ath0: STA <unit-mac-address> WPA: group key handshake completed (RSN)
If something goes wrong or you need some troubleshooting advice, see below.
To test if your ath0 device is set to AP mode, use this command:
# iwconfig
Verify that mode for ath0 says Master, if it doesn't say so your modprobe setup is wrong or your madwifi driver is too old. If your driver is older than r1407 the autocreate modprobe method doesn't work and you have to use the following command to set it up (can be used as pre-up in /etc/network/interfaces ath0 setup):
# /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode ap
To shut it down again, use this command (can be used as post-down in /etc/network/interfaces ath0 setup):
# /sbin/wlanconfig ath0 destroy
Be aware that the create function cannot be used without first issuing a destroy. If iwconfig lists an ath0 interface (in addition to wifi0) you need to destroy it before you can recreate it.
To verify your network setup, use ifconfig. It should list 5 interfaces: ath0, br0, eth0, lo and wifi0 - wifi0, ath0 and eth0 should not be assigned any IP, but br0 and lo should.
To verify that both interfaces are associated with the bridge, use this command:
# brctl show
To verify that your hostapd setup is correct, you can start it manually like this:
# hostapd -dd /etc/hostapd/hostapd.conf
If you get an error message that says "invalid argument, setting master mode failed", your ath0 interface is probably not in master mode. Check with iwconfig to make sure. Hostapd doesn't support setting master mode when using madwifi, it must be done by the driver itself. Verify your modprobe setup or look into wlanconfig.
Have a nice surf!
Follow these tips to boost Vista performance
By Robin Smidsrød on May 4, 2008 | In Software, Professional, Personal | Send feedback »
Link: http://techrepublic.com.com/2415-10877_11-91600.html
A very good article about ways to make Windows Vista perform better on borderline hardware.
I decided to keep only these settings activated in visual effects. It gives a nice balance between speed in good looks.
- Show preview and filters in folder
- Show thumbnails instead of icons
- Show window contents while dragging
- Smooth edges of screen fonts
- Smooth-scroll list-boxes
- Use drop shadows for icon labels on the desktop
- Use visual styles on windows and buttons
