Text

Fixing Weird Debian Locale Warning

I don’t how this getting started, since I rarely opening my linux box, but today I got these locale errors while running some a2dissite or scp command:

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LC_CTYPE = “UTF-8”,

LANG = “en_US.UTF-8”

    are supported and installed on your system.

perl: warning: Falling back to the standard locale (“C”).

And sometime it is not perl that said the error. Really weird.

Well, after getting busy yesterday, and in attempt to almost reinstall the box, I finally found this helpful solution, in Germany:

export LANGUAGE=en_US.UTF-8

export LANG=en_US.UTF-8

export LC_ALL=en_US.UTF-8

sudo locale-gen en_US.UTF-8

sudo dpkg-reconfigure locales

Don’t forget to add the sudo command prior to the last two commands, as necessary.

UPDATE: It seems I still have the issue. I’ll update when it can be fixed.

Text

Download Website’s Files with wget

wget -r -nH —cut-dirs=2 —no-parent —reject=”index.html*” http://somewebdirectory.com/that/has/

This is used for downloading directory that has files beneath it. To download regular website, just remove the —reject option and —cut-dirs.

Text

Downloading iOS SDK on slow connection with wget

Fixing previous complicated steps, here in summary:

1. Use Firefox plug-ins called Export Cookies, log in to iOS Developer Program portal, save your cookies to cookies.txt

2. Use this command to download the iOS SDK (with Xcode):

wget —server-response —continue —no-check-certificate —load-cookies=cookies.txt http://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.0.2_and_ios_sdk_4.3/xcode_4.0.2_and_ios_sdk_4.3.dmg

3. If you want to stop, just hit “Ctrl + C”

4. If you want to continue previous download, repeat the first two steps again. With —continue flag it will resume your previous aborted download and continue from there.

Link

ftp ftp://ftp.gnu.org/gnu/wget/wget-latest.tar.gz
tar -xvzf wget-latest.tar.gz
cd wget-{version}
./configure
make
sudo make install

Replace {version} with the version of wget that was downloaded (shown when unpacking the archive).

Text

Downloading big file (iOS SDK) with wget

Big file usually hard to get from slow connection like mine. Imagine if the file is around 4GB, like the iOS SDK installation program. Sometime it get disconnected while in half of the download. Or, it finished with the file being corrupted. Trying several times and you get no luck. Add that with authentication process for downloading, you get be damned!

Anyway, there is a way to that with simple tool called wget. This is the easy way to download big file from authenticated server (like iOS Developer program portal) to some remote server, from there, then you can easily download them to your local disk using download manager program, so they can be paused/resumed at any time conveniently.

  1. Open Firefox
  2. Install Export Cookies plugins
  3. Login to iOS Developer Program website (or any website) with your credentials
  4. Use Export Cookies, in Firefox: Tools -> Export Cookies -> save as cookies.txt
  5. Upload the cookies.txt file to your server

    scp cookies.txt user@domain.com:~/

  6. SSH to your server: ssh user@domain.com
  7. Then, in your user location ~/ type this command:

    wget —server-response —continue —no-check-certificate —load-cookies=cookies.txt http://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4.0.2_and_ios_sdk_4.3/xcode_4.0.2_and_ios_sdk_4.3.dmg

    This assumed to download the xcode 4.0.2 with iOS SDK 4.3. Change the link to the file you want to download.
  8. After your files has been downloaded succesfully in remote server, you can easily download it to your local disk by using any Download Manager program.

You also able to do similar result using curl. Please read its documentation to achieve the same thing. Of course you can use this command directly in your mac or linux box, just avoid the server uploading thing.

PS: You need to login and export cookies credentials at any time you want to download the file.

Good luck!

Text

iOS 4.3.2 Download Links from Apple

These are direct download links of iOS 4.3.2 IPSW files from Apple. Be sure to right-click and “Save As” the file, it should be a .ipsw extension:

Most users should update their iOS hardware through iTunes for ease of use, but you can learn how to use IPSW files if this interests you.

- Source OSXDaily

Text

Where does the Mac OS X Software Update files located?

So you are thrilled when new software update coming and doing it instinctly, you’ve come to this stage:

 

Wow, but I want to install it to my other computer without re-downloading it all again. Where does the Mac OS X save all their Software Update files?

After doing some Googling, here is the closest answer that I get form MacNN.

The location is in /Library/Updates.

BTW, you need to do some guess around to pick the correct latest update that you want. In most cases, guessing by the last Date Modified items are just enough. Take example in the screenshot below:

 

Enjoy!

Text

Solving MySQL Error #2002 when connecting from third party app like PHP

Open the terminal. Then type these code:

sudo mkdir /var/mysql

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

Reload the script page you wish to utilize the MySQL.

Text

Importing Textpattern posts to Wordpress

I got this basic information for importing content from Wordpress’s Importing ContentCodex page. But the Textpattern guide on that page seems obsolete, so I create this alternative by utilizing Movable Type export format to easily import them into Wordpress.

1. Create new form for article export templates, let’s call it article_export .

We use this form to create Movable Type template used for export. Please refer to theMovable Type export format for complete references, in case you need to export more contents from your blog. Since my blog doesn’t incorporate comments and ping, this become lots easier.
Here are the code for the new form

:

TITLE: <txp:title />
AUTHOR: <txp:author />
DATE: <txp:posted format=”%m/%d/%Y %H:%I:%S” />
CATEGORY: <txp:section title=”1” />
——-
BODY:
<txp:body />
——-
EXCERPT:
<txp:excerpt />
——-
————

Don’t forget to add breakline in the line of the new form entry!

Also, be aware with date setting. Most of all above template will just works.

2. Create new page that utilizing the previous form, let’s call it page_export

Here are the code for the new page:

<txp:article_custom limit=99999 form=”article_export” />


3. Create new section that using previous page, let’s call it export.

4. Then open the new section in your browser. This can be something like this:

http://yourdomain.com/export/

5. Voila, you just creating Movable Type format export entries. After all content has been loaded, save the text into something called mt-export.txt.

6. Now login to Wordpress. Go into Tools -> Import. Install the Movable Type and Typadpad import tools.

7. After it has been installed, just go there, and click the Import mt-export.txt button (the second bottom). After that, please arrange the proper author creation, whether you need to arrang the author into existing author in the Wordpres or just let the importer create new author for you (in most case for new blog import, this is the way).

8. No more step, you’ve done importing all Textpattern entries from your blog.

Text

Hello

This is my Tumblr.

It is my digital scrapbook for whatever unrealistic reason I have.

Thank you!