GIT – How to merge specific files from another branch

Posted in category Programming, Unix/Linux, Web

Using GIT you can merge specific files from another branch using the ‘checkout’ command. After you checkout the files do a commit on the current branch.

Example:

$ git checkout anotherBranchName  path/to/file.etx    path/to/file2.ext     path/to/file3.ext

$git commit -m “Merged files from anotherBranchName”

Digital photographic mosaics using AndreaMosaic

Posted in category Graphics, Windows

Using Andrea Mosaic you can create interesting digital photography mosaics. A photo mosaic is an image composed of many tiled photos.

AndreaMosaic is free to download.

Visit the page at: www.andreaplanet.com/andreamosaic/

M-AUDIO Fast Track Ultra not recognized. Problem identified.

Posted in category Audio

m-audio-fast-track-ultra-front-rear

A number of M-AUDIO Fast Track Ultra devices has a problem of not being recognized by the operating system or losing connectivity after system restart.
M-AUDIO has identified the problem, and it is a technical one which requires the device to go into repair.

If the 6th digital is the letter “F”, there is a chance your device may be affected by this malfunction. M-AUDIO tech support should be contacted.

Official statement:

http://www.m-audio.com/index.php?do=support.faq&ID=c17d49f17f7934b753e219d88b4dd8e0

*TIP: If your device is not recognized by the operating system, try quickly switching it on and off several times in a row.

Linux server – Change default timezone

Changing the timezone on a Ubuntu/Debian server can be done using the following command:

su dpkg-reconfigure tzdata

Use GMail to send emails through the Linux consolse

If you need to be able to send simple, one user account emails from a Linux server which has no mail server configured then this is for you.

Additionally you can use GMail to send messages from.

Install software:

# apt-get update

# apt-get install ssmtp

Edit configuration file:

#nano /etc/ssmtp/ssmtp.conf
AuthUser=myaccount@gmail.com
AuthPass=gmailpassword
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

Test:

# echo “email test” | mail -s “Email test” myemailaddress@domain.tld

VirtualBox – Disable Date and Time synchronization for a VirtualBox Guest system

The following command will disable the date/time synchronization for a Guest operating system.

Assuming the host is running Windows OS.

Open the command prompt. (Run -> cmd)

Enter command:
C:\Users\User>”c:\Program Files\Oracle\VirtualBox\VBoxManage.exe” setextradata ENTER_MACHINE_NAME_HERE “VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled” “1″

* Replace ENTER_MACHINE_NAME_HERE with Guest system name
* This command will add an extra line to the “C:\Users\User\VirtualBox VMs\MACHINE_NAME\MACHINE_NAME.vbox” file.
* To enable the sync again, edit the file above

UPDATE:

If GuestAdditions have been installed, they will automatically sync the clock. Disable GuestAdditions.

# /etc/init.d/vboxadd-service stop

MySQL InnoDB table truncate fails because of foreign keys

Posted in category Database

If trying to truncate MySQL InnoDB tables and you are getting an error because of foreign keys constraints try disabling the foreign keys checks.

SET FOREIGN_KEY_CHECKS = 0;
..
TRUNCATE tableName;
TRUNCATE tableName2;
..
SET FOREIGN_KEY_CHECKS = 1;

MediaWiki – List all namespaces and their ID numbers

Posted in category Web

To list all available namespaces and their ID numbers in MediaWiki you have to query MediaWiki’s api.

Simpy open the following address in your browser:

http://www.mywebsite.tld/mediawiki_installation/api.php?action=query&meta=siteinfo&siprop=namespaces

*replacing http://www.mywebsite.tld/mediawiki_installation with the path to your MediaWiki page.

This will return a XML representation of Namespaces data.

Linux Ubuntu – User not in the sudoers file

Posted in category Unix/Linux

If your user is not in the sudoers file you won’t be able to do any root tasks.

To fix this:

1. Boot into the recovery mode and load the root console. (Hold left shift on boot to show the Grub loader)

2. To make the file system writable execute: mount -o remount,rw /

3. Add user to the group admin by executing: adduser username admin (additionally you can add the user in the sudoers file, command: visudo)

4. To finalize the changes execute: sync ; mount -o remount,ro / ; reboot -f

WordPress Custom post type and pagination problem – Error 404

Posted in category Wordpress

1.5hour of pure frustration.

After registering a custom post type, slug “news”, and creating a page “news” to display the latest posts the pagination just wouldn’t work. I was always getting a 404 error. Setting the permalinks to default and back to the old setting solved the problem.


$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$wp_query = new WP_Query("post_type=news&paged=$paged&posts_per_page=1");

if (have_posts()) :
....

UPDATE:

WordPress 3.1 supports archive pages for custom post types. Add “has_archive” => true when creating the custom post type. No custom page required any more. Name the archive page: archive-customPostTypeName.php

Paging still has problems. Setting the default wordpress posts per page value lower or same as the custom wp_query(“posts_per_page”) value solves this somehow. Weird.