Updating WordPress without using FTP

FTP. It’s so… 80s… It’s based around the thought that network traffic probably won’t be sniffed and that the guy next to me won’t crawl through my files. Basically it’s a relic from a time when people thought the internet would be a glorious place to advance mankind rather than being the world’s biggest contest of who can hoard the biggest amount of porn.

Coincidentally SSH was created 1995, about 10 years after FTP to clean up with the mess of uncrypted 80s protocols. In today’s modern computing world, SSH is basically the standard for safe and versatile command-line access and port-forwarding.

Why am I writing all of this? Well, Jidder did the right thing and disabled FTP on this server, leaving only SSH to update and maintain my WordPress installation. The thing is: WordPress doesn’t really like SSH all that much. But as usual, there are mysterious and dark ways around it.

Updating WordPress installations through SSH – How I loved rsync once again

Did I mention that SSH is great? I’m sure I did. Another great tool is rsync. And wget. Gosh, there are so many of them. But let’s focus on rsync right now. You can manually download the WordPress update package with wget and unzip it. But when it comes to moving the files around – there will be blood. mv doesn’t like it when you move non-empty directories onto other non-empty directories and starts crying.

Thankfully rsync isn’t such a pansy. Yeah, you heard me, mv!

rsync -arv --remove-source-files * ../blog/.

That’s all it takes for rsync to move all the files from your wordpress-* directory to your blog. That’s one way to update WordPress without FTP access. But there’s a small problem with this: Updating your hundreds of plugins that way takes time. It’s inconvenient. It’s no good.

The dark art of config-editing – Getting more… direct

A somewhat better way would be to let WordPress use your login and do all the dirty work itself. Lo and behold, that is indeed possible with a few simple, additional lines to your wp-config.php:

define('FS_METHOD', 'direct');
define('FTP_BASE', '/var/www/whatever/you/like/');
define('FTP_CONTENT_DIR', '/var/www/whatever/you/like/wp-content/');
define('FTP_PLUGIN_DIR', '/var/www/whatever/you/like/wp-content/plugins/');
define('FTP_HOST', 'host.domain:22');
define('FTP_USER', 'my_username'); 
define('FTP_PASS', 'my_password');

Don’t forget to adjust your permissions on the wp-content/plugins folder to ensure the user your web-server runs in can access/write to the directories (for updating plugins).

 

Fixing Newshosting’s GTK+ crash on startup

So yeah, I’m a big fan of Newshosting. The best thing about them is probably that they have their own (very capable) desktop-client and that aforementioned client is available for your major operating-system of choice (namely Windows, Linux and OSX).

A problem I ran into while trying out the program: As long as I am in a GNOME session, the client would crash on startup with a message like “(<unknown>:10800): GdkPixbuf-WARNING **: Bug! loader ‘png’ didn’t set an error on failure”.

After throwing my problem at Google I came across this nifty post that presented me with a straight-forward solution:

Just run as root:

update-mime /usr/share/mime/
update-mime-database /usr/share/mime/
gtk-update-icon-cache /usr/share/icons/YourTheme

Logout/Login and it will be all right now 🙂

And all right it was, indeed. Thank you, internet!

WinSCP alternative for GNU/Linux desktops

Let’s be honest: While it’s okay to work on the command line, I do prefer to use a graphical application for file-operations.

On Windows you can use WinSCP to work on remote systems via SSH. There are quite a number of questions whether there’s a good alternative for the GNU/Linux desktop available.

Filezilla is probably the premier choice when it comes to FTP clients but it is suprisingly well-groomed for SCP/SFTP as well. The application runs rather stable, doesn’t simply stop during file-transfers and also handles move/copy operations gracefully.

For my needs Filezilla is the best choice. It’s simple and does what it is supposed to do. Filezilla also sports a great “bookmark” system for different connections, allowing me to quicklyswitch between my web-hosts – no matter whether SCP or FTP.

In short: Go with Filezilla if you need an alternative to WinSCP for GNU/Linux.

Wuala isn’t dead

If you haven’t been living under a rock you probably heard that Wuala recently changed a few things. The trading feature has been removed for good, if you want to get your precious online storage without paying, your only chance is mining bitcoins now – which you can use to pay for extended storage programs on Wuala.

That sounds pretty bad, doesn’t it? The big feature that we all loved, the one feature that set Wuala apart from the rest, is gone. Booh hoo.

Let me tell you why Wuala is still the king of online storage: Pricing and the number of supported platforms.

No other hosted service gives you that much bang for your buck. For about 100€/year you get 100GB, that’s an incredibly good deal. If you believe Dropbox or an S3-based solution is cheaper you obviously need to check the prices again. Symform (no hard feelings, I love your service!) certainly looks attractive price-wise but falls short in the “team” or “group” aspect, thus making it a rather poor choice to compare against.

As for self-hosted solutions: If I already pay ~50-100€ per month for a (v)server and want to give my peer-group of 5 people access to 100GB of data, I better find a plan that comes with a flatrate for traffic – otherwise one month of self-hosting will cost me more than one year on Wuala. Even if I split the costs between my 5 peers, I’ll still end up with something more expensive.

Of course I’d love to see a more group-oriented, non-business plan that would allow me to donate space to my existing groups. I realize this is a big headache to implement – but it would be cool. 🙂

If you can name one service that runs on Windows, Linux, OSX, Android and iOS devices, integrates well into the big three’s file-systems, has social/group aspects, file-versioning, client-side encryption, intelligent caching and (soon) delta updates: Tell me, because I’d love to give that solution a go. 🙂

Wuala isn’t dead. At least not until the prices and platform availability of other products are on Wuala’s level. And let’s be honest: That will take a while.

I’m using the software since 2008 and still haven’t found a better way to share files with friends online. I tried Spideroak, Dropbox, Teamdrive, Ubuntu One and various other solutions I don’t even remember by name anymore and always came back to Wuala.

Gaikai Beta

Let’s face it: Upgrading a perfectly fine PC every year sucks. I’m still playing on my 4-year old gaming rig (not on high details and not the AAA titles, of course) but I do the rest of my daily routine on a small eeeBox running GNU/Linux. However, sometimes I’d like to play without booting up my gaming rig, searching for DVDs or waiting for Steam to finish a download. And I want to play on high detail, of course.

With OnLive and Gaikai this could become very much a choice. These services allow players to “stream” live games without installing them, without having to have the necessary graphic cards – all you need is a broadband internet connection.

While OnLive has had a very bad start with me (me being European and therefore undeserving of their service), Gaikai Inc.’s Gaikai service does allow European players to stream games live from the web.

Yesterday I got my beta pass to play the demos of Dead Space 2 and Mass Effect 2. The demos are limited to 30 minutes each – more than enough time to get a good view on the games and the cool technology Gaikai uses.

Remember that I’m on GNU/Linux here? Good. All you really need is a browser, the Flash plugin and Java.

The graphic quality is very good. I couldn’t get full-screen mode to work but expect this to be fixed before Gaikai goes gold. Sound is great, the response times for the controls are somewhat mushy – however that could also be due to the nature of the games. I remember Dead Space being fucking annoying in terms of controls and Mass Effect certainly wasn’t much better. So I guess I’d have to see Team Fortress II or some other adrenaline-loaded shooter to really make a call here.

So is this a service I’d use? Currently it’s hard to say. If Gaikai Inc. manages to get an all-genre catalogue of the cool & hip stuff from the publishers and translates their subscription model to a Crunchyroll-like “season pass” model, I certainly see myself tempted to use it. I’m already buying digital content from Steam, so why not skip the “upgrade, download, patch” cycle and go with Gaikai? At least for single-player games this is probably a good choice.

As for multi-player games… I think Steam is and will always be the platform of choice. People don’t want to be at disadvantage with even a few more milliseconds of input latency, so I don’t see cloud-gaming services in this sector.

I hope publishers will see the advantage of Gaikai’s services. Deploying demo versions of current generation games is nearly impossible (due to the size and complexity of the games) – so Gaikai is an attractive option. It also reduces the problem of piracy and ensures that people will always have the latest patches available.

The next year will be interesting. OnLive will finally start it’s European service (apparently), Gaikai may go live – it will be interesting to see which one of these services will make it easier to play on every platform and operating system. The games catalogue will be an interesting criteria as well. Let’s wait and see.

It’s like I’m in The Shining

So, as posativ pointed out the infamous Jugendmedienzensurstaatsvertrag is off the table (at least for now, although we all know proposals like this never die) – so let’s stick it to the man and keep the posts rolling.

What’s new?

If you’ve been wondering why tray icons in Ubuntu aren’t transparent, the answer is simple: The maintainers compile the applets with the wrong flags. To get your transparent tray icons back, do this:

– Grab the build-dependencies and the source for gnome-panel through apt-get
– Edit the debian/rules file and add the flag ”–with-in-process-applets=notification-area” to DEB_CONFIGURE_EXTRA_FLAGS
– Rebuild the package, install and enjoy.

Kind of sad that this problem seems to exist for a long time now and no one seems to care.

Thanks for all the fish.

Thanks to the ingenuity of German politicians I am required to either tag every article of this page for age restrictions and child protection  (an impossible task) or would have to authenticate you to make sure you are indeed over 18 years old (also an impossible task).

Another possibility would be to restrict access to this weblog based on the current time. But since I am not the administrator of this server and the FTP access is defunct for quite some time this is the only way I see right now.

So that’s why every article and every page on this blog are now offline.

Enjoy Tsukasa no Hibi (child-friendly version) in a clean, pure manner.

Flashing the PC Weasel PCI

I recently purchased a PC Weasel PCI card off eBay. While I’m having trouble getting the thing to run as I wish in my fileserver it does indeed work fine on my bare-metal test computer. One thing that bugged me a lot was the process of flashing firmware onto the PC Weasel. It supports up to 7 different firmware partitions but flashing them from command line is a real pain and with my limited knowledge of kermit and minicom I was totally dumbfounded.

Thankfully SecureCRT is always a viable option for one’s console needs (when using Windows, that is). PuTTY is cool but SecureCRT is great – it allows for massive scripting and is even recommended in the PC Weasel manual. So I did some scripting and this is the result:

[code language=”vb”]
# $language = "VBScript"
# $interface = "1.0"

‘ ****************************************************
‘ * *
‘ * PC WEASEL PCI FLASH HELPER FOR SECURECRT *
‘ * *
‘ * written by Tsukasa *
‘ * for SecureCRT 6.6.0 *
‘ * *
‘ * INSTRUCTIONS: Set the jumper for safeboot, open *
‘ * a serial connection through SCRT, *
‘ * run the script and power on the *
‘ * target machine. *
‘ * Cancel the script as soon as the *
‘ * S19-line input is done and set the *
‘ * remaining options manually. *
‘ * *
‘ ****************************************************

‘ ##### Edit the 3 values below ##### ‘

Const FirmwareFile = "PCIweasel_2.07_s19"
Const FirmwareName = "PC Weasel v2.07"
Const FirmwareSlot = "2"

‘ ##### DO NOT EDIT ANYTHING FROM HERE ON #####

Const ForReading = 1
Const ForWriting = 2

Sub Main
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.OpenTextFile(FirmwareFile, ForReading, False)

‘ Wait for boot menu input
crt.Screen.WaitForString "[x]–>"

‘ Enter flasher…
crt.Screen.Send "l"

‘ Select partition to flash…
crt.Screen.WaitForString "Partition number for image [1-7]:"
crt.Screen.Send FirmwareSlot

‘ Give the new firmware a name…
crt.Screen.WaitForString "Image name"
crt.Screen.Send FirmwareName & Chr(13)

‘ Erase partition…
crt.Screen.WaitForString "Erase this flash partition?"
crt.Screen.Send "Y"

‘ Wait until PC Weasel is ready to receive the S19 lines…
crt.Screen.WaitForString vbNewLine & ">"

‘ Send the S19 lines until finished
Do While file.AtEndOfStream <> True
str = file.Readline
crt.Screen.Send str & Chr(13)
crt.Screen.WaitForString ">"
Loop
End Sub
[/code]

This simple script will do most of the handiwork for you. It works well for me so I’m fine with it being somewhat incomplete 🙂 .

XBMC and Lirc – bleh

Since I got a Xbox 360 Universal Remote quite some time ago (actually: when a friend of mine decided that the Xbox 360 is a terrible console and not worth having – a sentiment I can only share) I was always keen on getting the little bugger to work with XBMC. Lady Luck smiled at me when I finally found a cheap RC6-compatible USB IR-receiver on eBay. Just to get you some idea what I bought:

Bus 003 Device 002: ID 147a:e017 Formosa Industrial Computing, Inc. eHome Infrared Receiver

Yep, it’s one of the run-of-the-mill Formosa SnowFlakeEmulation thingies you find in just about anything from Acer laptops to small projector addons. I don’t know about you but that’s more than I could ever ask for (at least for the 2€ I paid) and the device works flawlessly with Lirc and the Xbox 360 remote (as long as the batteries don’t die on you). So, easy peasy to get all the stuff I already hacked together wired into XBMC, eh? Not at all. You see, XBMC does try – and I’m not doing anything wrong methinks – to use /dev/lircd as an endpoint for Lirc. The commandline –lircdev gets ignored completely. Maybe I’m missing a link here. The solution is pretty simple: Create a symlink to /var/run/lirc/lircd, start XBMC and rejoice – it verks!

Run Wuala as a Windows service

One of the more common questions is how to run Wuala as a Windows service. There is a thread describing how to run Wuala as a scheduled task which may satisfy some people – but let’s face it: You probably want a real service, you know, one you can control through “net start” and “net stop”.

Setting up your own services on Windows is pretty easy these days. You either shell out squid for FireDaemon or go the free way with srvany. If you don’t like fiddling around with software this piece of software may interest you. It is a simple service wrapper for Wuala written in C# that installs a new service called wuasrv and starts/stops the client software accordingly.

Installation is dead simple:

– Configure Wuala (i.e. check the “remember password” box)
– Unpack WualaService
– Edit WuaSrv.xml and alter path to point to your wuala.exe
– Run ServiceInstaller.exe
– Open the Windows service manager, select the Wuala service, go to it’s properties and change the account it runs under (running Wuala under SYSTEM account may not be such a great idea)
– Start the service and rejoice.

Configure Wuala to auto-login and enable the Dokan integration to get your W: drive right at boot 🙂 .

I’ll post the source-code to the programs later on, so enjoy 🙂 .

NX Client and Sandboxie bitching?

So, I decided to re-install my laptop today.

One thing that got me curious: The NX Client and Sandboxie started showing strange phenomenons.

Sandboxie couldn’t quick-restore files from the sandbox (permission denied error) and the NX Client couldn’t find the default key.

Turns out that both problems have the same root: Cygwin.

After some tries with Try & Decide I pinned down the problem to E Texteditor’s integrated Cygwin installation. Even using the official Cygwin setup and standard install wouldn’t help.

The quick fix for this is to not use an external Cygwin installation in conjunction with these two programs.

Quite a bummer. If anyone has a better fix, feel free to leave me a comment 🙂 .