February 2012
4 posts
[Typo3 tt_news] How to fix "No news in this list" →
Do you always get “no news in this list” (in German: “Keine News in dieser Ansicht”) although tt_news is correctly set up? Then maybe it’s because you have a LATEST plugin somewhere and the items shown there are not displayed in a LIST anymore. To avoid this, add
plugin.tt_news.excludeAlreadyDisplayedNews = 0
to your template (TypoScript setup).
There is a...
1 tag
[Typo3] Install a cronjob yourself without hoster...
If you host a Typo3 installation at a provider where you don’t have shell access, need a custom cron job for the Typo3 scheduler and the host’s configuration interface (Plesk, for instance) is somehow cumbersome (for instance, it may limit your cron job to a chrooted shell and PHP isn’t installed the chroot environment, so you can’t start PHP scripts from there), you can...
1 tag
[Typo3] Using direct_mail with external SMTP...
There are several traps when using Typo3 4.5 and the direct_mail newsletter extension with an external SMTP server. Here’s how to set it up:
First of all, prepare the SMTP server (for instance, by allowing the IP of the Web server as relay host or setting up user authentication).
In the Typo3 Install tool, set the [MAIL] settings correctly (transport=smtp, transport_smtp_server,...
Cisco WebVPN: "applet not initialized"
If you connect to Cisco WebVPN with port-forwarding and get the message “applet not initialized” although Java applets work in your browser, you may have to enable third-party cookies in your browser.
December 2011
2 posts
Converting DBF to CSV files
How to convert DBF to CSV files:
1) Install PERL, DBI, and DBD::XBase (comes as a package for many Linux distributions).
2) Use a script like this one:
#!/usr/bin/perl
use DBI;
my $dbh = DBI->connect("DBI:XBase:/directory/of/dbf/file") or die;
my $sth = $dbh->prepare("select * from YourDbfNameWithoutFileExtension") or die;
$sth->execute() or die $sth->errstr();
# adapt column...
2 tags
Android: generate incoming SMS from within your...
(Tested with Android 2.3.3 SDK)
Sometimes, you need to simulate an incoming short message for your app. For instance, an encryption app could need to intercept incoming SMS using a BroadcastReceiver, then check if the SMS was encrypted and if so, decrypt it. Then the decrypted SMS and not the original one should be processed further (show up in SMS app etc.).
The usual way is to create a...
November 2011
1 post
1 tag
How to restart god after deploying a Rails app...
If you use the God gem to manage your Ruby on Rails application server (Unicorn, for example), you will have to restart the application server using God after deploying a new version.
I found a solution that polls the application’s tmp directory for restart.txt (like Phusion Passenger does) from within the god configuration and restarts the app if the file is touched. However, it...
October 2011
1 post
2 tags
[FreeBSD] unicorn.god
I had a very strange problem concerning my Ruby on Rails installation, using FreeBSD, nginx, Unicorn and God.
When starting god from the command line as root, everything worked. However, as soon as I placed the god command into /etc/rc.local or a even service file in /usr/local/etc/rc.d, god didn’t start the Unicorn server but showed exit code 127 for “bundle exec unicorn -E...
September 2011
2 posts
Anonymous asked: hey, when u installed ts3 on freebsd, did u get the serveradmin password??
2 tags
Ruby 1.9 invalid multibyte char (US-ASCII) when...
If your Rails app works fine after upgrading to Ruby 1.9 (including bundler install in development environment), but throws an error like this when you deploy it via Capistrano:
... capistrano runs bundler as deployment user ...
... invalid multibyte char (US-ASCII) ...
make sure that the environment variables are set correctly for this user, especially that the LANG variable sets UTF-8 as...
August 2011
4 posts
On-the-fly RSA encryption for secure transmission... →
I created a new plug-in / gem called acts_as_securely_transferable. It provides on-the-fly RSA encryption for secure transmission of forms/resources over non-secure connections.
See README for more details.
Why pay for an SSL certificate when JavaScript... →
This is a very nice solution to encrypt password fields, credit card numbers etc. in a secure way without needing an expensive SSL certificate. Of course, the authenticity function is lost (i.e. the end user can’t verify who you are, but anybody can buy an SSL certificate too so it doesn’t make much difference). The important thing is the secure transmission of the secret details.
It...
Why it doesn't make any sense to move invalid HTML...
When I added the Google +1 button to one of my Web sites, I noticed that the button code given by Google is not valid HTML 5. There is a HTML 5 version, but when used with i18n (for instance, in German) the JavaScript code is:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'de'}
</script>
Now this isn’t valid HTML 5 because the script tag...
1 tag
Google: Please give me the -1 button
Where I can vote down (only for me! and maybe Google friends) all these crappy sites that are spamming the search results.
July 2011
2 posts
1 tag
FreeBSD: finding out free/total memory →
As there is no “free” like in Linux by default, I found this script which gives a good overview about the current RAM usage on FreeBSD systems.
The “freecolor” port doesn’t work for me because it’s only available for i386 systems.
1 tag
Rails security: mass assignments allow assocations...
Inspired by http://railspikes.com/2008/9/22/is-your-rails-application-safe-from-mass-assignment
If you’re using associations, they can be set by mass-assignment by default. For instance:
class Property
has_many :rooms
end
class Room
belongs_to :property
end
Assuming this code for room creation:
@property = Property.find params[:id]
@room = @property.rooms.create params[:room]
...
June 2011
1 post
1 tag
simple_format, auto_link and :rel => 'nofollow'
Rails 3.0.6+
If you use auto_link to mark up links in your text, you can add the rel=”nofollow” attribute like this:
auto_link(@text, :html => { :rel => 'nofollow' })
However, if you also want to use simple_format:
simple_format(@text)
you can’t combine this by default:
simple_format(auto_link(@text, :html => { :rel => 'nofollow' }))
because then the...
May 2011
1 post
1 tag
Installing TeamSpeak 3 server on FreeBSD
I have made a FreeBSD port for the TeamSpeak 3 server (audio/teamspeak3-server), for amd64 and i386 architectures.
To install the port:
cd /usr/ports/audio/teamspeak3-server
make
make install
or, if you have installed portupgrade:
portinstall teamspeak3-server
It adds a teamspeak system user automatically, installs TeamSpeak into the correct directories and adds an rc.d entry. To enable...
April 2011
1 post
2 tags
Xerox Phaser 6110N network password reset
After studying the manual, the service manual, various Internet sites, 3 calls to the Xerox hotline and a lot of help-requesting mails to Xerox partners (not a single one answered even when I offered money for a simple answer), I can now say that:
The Xerox Phaser 6110N network password (for the Web interface) cannot be reset. If you forget it, you can’t use the networking functionality...
February 2011
4 posts
2 tags
Gigabyte "Easy Energy Saver" not so easy without...
Me: Regarding the "Easy Energy Saver" function: Is it a hardware feature that is always available or do I need the Windows EES application/Windows drivers to run? I only use Ubuntu Linux on my system and I'm interested in maximum energy saving.
Gigabyte: [...] It's hardware oriented designed but needed to be driven by software.
There is no software for Linux.
Officially we don't support any Linux distribution.
Me (thinking): "There is no software for Linux", so energy saving is only available if you buy and use Microsoft(R) Windows(R) all the time. With any other operating system, you have to waste electrical power and harm the environment, we're sorry.
1 tag
14 W power for a PC "turned off"
My personal power measurements:
Soft-off (G2) PC: 14 W - this means that your computers need 14 W power when it’s “turned off”
2 PCs in “soft off” (one mainboard with ErP activated, i.e. <1W in soft-off) + 2 flat screens + 5.1 sound system in standby: 22 W
2 PCs (normal CPU usage) + 2 flat screens: 470 W
2 PCs (3D games) + 2 flat screens:...
Solution: RTL8111/8168B doesn't work in Linux...
If you have a “Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)” in your PC and the following problem:
NIC works in (Ubuntu) Linux
Boot into Windows (Win7), NIC works there
Boot into Linux again, NIC doesn’t work anymore (not recognised)
Plug your PC off the AC
Boot into Linux, NIC works again
There’s the solution:...
Even breadcrumbs can be marked up for Google with... →
January 2011
4 posts
1 tag
FreeBSD support times →
For everyone who doesn’t know which FreeBSD version to choose
1 tag
Rails 3: validation against StopForumSpam.com →
I have made a Rails 3 plug-in to validate ActiveRecord comment models against StopForumSpam.com. Patches welcome, see README. Example usage:
class Comment < ActiveRecord::Base
validates_against_stopforumspam :fields => { :username => :name, :email => :email, :ip => :ip }
end
Canon CanoScan Lide 35 on Windows 7 (64-bit)
Download the 64-bit Win7 drivers for Lide 60 (those are available)
Force Windows 7 to use them using the hardware manager (manual install)
It will work.
When you would only do what Canon say, you could trash your Lide 35 when you want to use Windows 7 (64-bit, as expected on modern systems).
PS: The scanner works out-of-the-box with Ubuntu (64-bit, of course).
Facebook's "server whitelist"
If you create a Facebook app, don’t put your server IP into the “server whitelist” field and use the JavaScript SDK. It seems that all requests are validated against these IP addresses, even if they originate from a client.
The error message is not “Access denied” (as you could expect), but only “We’re sorry, something went wrong”....
December 2010
2 posts
2 tags
Installing iconv using Bundler on FreeBSD
Because the iconv library files reside in /usr/local/{include,lib} and not in /usr/{include,lib} like on Linux system, the iconv gem has some problems when you do gem install iconv:
[root@wurd /usr/home/richard]# gem install iconv
Building native extensions. This could take a while...
ERROR: Error installing iconv:
ERROR: Failed to build gem native...
Hacking Netgear WDNR3700 (with original firmware) →
./telnetenable works for me! Means that WDNR3700 can be hacked by anyone with LAN/WLAN access (except “guest networks” with disabled “access to My Network”) and without admin password. And it means that you can see that the firmware is OpenWRT with some add-ons.
“Debug mode” circumvents security measures.
November 2010
4 posts
1 tag
"Guest network" for WNDR3700 with DD-WRT instead... →
1 tag
Mount SAMBA share using FreeBSD
To mount a SAMBA share from within a script (for instance, backup script) using FreeBSD 8.1:
mount_smbfs -N //username@server/share /mnt/backup
-N prevents mount from asking for the password. You have to store it in ~/.nsmbrc or /etc/nsmb.conf (didn’t try the last one). You can’t use an Internet hostname for the server name because it has to be a network server name as used by...
2 tags
Rails 3 bundler (FreeBSD): operation not permitted →
Do you get “operation not permitted” messages when doing bundle install with Rails 3 and FreeBSD? Export RB_USER_INSTALL=1 and then do bundle install.
3 tags
Rails: Twitter/identi.ca follower count
How to add a Twitter / identi.ca follower count to your Rails project:
Helper:
def twitter_followers(api, user)
begin
profile = Hash.from_xml(Net::HTTP.get(URI.parse("http://#{api}/users/show/#{user}.xml")))
profile[‘user’][‘followers_count’]
rescue
’?’
end
end
View:
<p><%= twitter_followers(‘identi.ca/api’, ‘gimpusers’) %> <a...