Category: Geek

Dual Monitor Setup on Kubuntu 9.10 with KDE 4.3.2

I bought another monitor today, and found that it was actually quite easy to set up with KDE and Kubuntu (Karmic Koala). I have an ATI Radeon HD 4830, and I use the proprietary drivers.

Anyways, here’s what worked: instead of doing it KDE or Ubuntu-style, I set the monitors up with ATI’s AMD Catalyst Control Center. If you have the fglrx drivers installed, then you probably already have it: run it with

sudo amdcccle 

from the command line.

You’ll get something like this:

ATI Catalyst Control Center Kubuntu Linux

Anyway, make sure your screens aren’t clones of each other in the Display Manager part. That’ll let you enable xinerama under Display Options. Apply the settings, restart your computer, and you should have two fully-functioning, non-cloned monitors!

My xorg.conf is below, just for reference:

Section “ServerLayout”
Identifier   “amdcccle Layout”
Screen     0 “amdcccle-Screen[1]-0” 0 0
Screen       “amdcccle-Screen[1]-1” 1920 0
EndSection

Section “Files”
EndSection

Section “Module”
Load “glx”
EndSection

Section “ServerFlags”
Option   “Xinerama” “on”
EndSection

Section “Monitor”
Identifier   “0-DFP1”
Option   “VendorName” “ATI Proprietary Driver”
Option   “ModelName” “Generic Autodetecting Monitor”
Option   “DPMS” “true”
Option   “PreferredMode” “1920x1200”
Option   “TargetRefresh” “60”
Option   “Position” “0 0”
Option   “Rotate” “normal”
Option   “Disable” “false”
EndSection

Section “Monitor”
Identifier   “0-DFP2”
Option   “VendorName” “ATI Proprietary Driver”
Option   “ModelName” “Generic Autodetecting Monitor”
Option   “DPMS” “true”
Option   “PreferredMode” “1920x1200”
Option   “TargetRefresh” “60”
Option   “Position” “0 0”
Option   “Rotate” “normal”
Option   “Disable” “false”
EndSection

Section “Device”
Identifier “Default Device”
Driver     “fglrx”
EndSection

Section “Device”
Identifier “amdcccle-Device[1]-0”
Driver     “fglrx”
Option   “Monitor-DFP1” “0-DFP1”
BusID     “PCI:1:0:0”
EndSection

Section “Device”
Identifier “amdcccle-Device[1]-1”
Driver     “fglrx”
Option   “Monitor-DFP2” “0-DFP2”
BusID     “PCI:1:0:0”
Screen     1
EndSection

Section “Screen”
Identifier “Default Screen”
DefaultDepth   24
SubSection “Display”
Virtual   3840 1200
EndSubSection
EndSection

Section “Screen”
Identifier “amdcccle-Screen[1]-0”
Device   “amdcccle-Device[1]-0”
DefaultDepth   24
SubSection “Display”
Viewport   0 0
Depth   24
EndSubSection
EndSection

Section “Screen”
Identifier “amdcccle-Screen[1]-1”
Device   “amdcccle-Device[1]-1”
DefaultDepth   24
SubSection “Display”
Viewport   0 0
Depth   24
EndSubSection
EndSection

Above is the Catalyst Control Center-generated xorg.conf that worked for me when Krandrtray, Gnome’s display panel and KDE’s display settings didn’t do anything. Let me know in the comments if you have any questions.

Also, here’s what my desktop looks like now:
image
(Click the thumbnail for a full-size version)


Posted on Jan 25, 2010 - 04:06 AM

Fun little toy I made: a Reddit dubstep application

Check it out: http://dubstepp.com/. Basically, it scrapes reddit.com/r/dubstep for YouTube links (tracks) and aggregates them all in one place.

I particularly like the search function. It’s actually quite useful.


Posted on Dec 07, 2009 - 06:41 PM

Search function for the User Groups module for ExpressionEngine

I wrote a quick search function for the User Groups module for ExpressionEngine. It searches groups (names and descriptions) as well as topics and topic replies. It respects group types as well - results from private groups will not show up in the topic or topic replies search results. You can download it here or see it here.

It’s very simple and can probably be optimized, but it works.

Let me know if you have any questions or comments. I’ll probably end up updating it as new versions of the User Groups module come out.

The search form I use with it is below:

<form id="group_search" method="post" action="{homepage}/groups/search/">
<
input type="text" id="group_search_box" name="group_search_box" />
<
input type="hidden" id="member_id" name="member_id" value="{member_id}" />

<
input type="radio" name="search" value="search_discussions" id="search_discussions" checked>Discussions
<input type="radio" name="search" value="search_groups" id="search_groups"Groups<br>
<
input type="submit" value="Submit"/>
</
form

Posted on Nov 19, 2009 - 07:15 PM

How to create categories from the frontend in ExpressionEngine

I figured out a nifty way to let users on the frontend create categories in the backend. (This isn’t currently possible with the SAEF.) It’s a little bit of a hack, but it works - if you have improvements upon it, please let me know.

You’ll need two templates: one with the form that the user submits with the category name and description (I’ll call this the index template), and one with PHP enabled (parsed on input, NOT output), which I’ll call the create template. In this instance, I’m creating a groups equivalent for users based on categories.     

Here’s the entire contents of my index template:

<form action="{homepage}/groups/create/" method="post" name="group_create">
<
p>Group Name
<input type="text" name="group_name">
<
br />
Group Description
<
input type="text" name="group_description">
</
p>
<
input type="submit" value="Submit" />
</
form

And here’s what I have in the create template:

<?php

global $DB$REGX;

$_POST $REGX->xss_clean$_POST );

$cat_query $DB->query("SELECT AUTO_INCREMENT FROM information_schema.tables WHERE 
table_name='exp_categories' AND TABLE_SCHEMA='your_db_name' ORDER BY Auto_increment DESC LIMIT 1"
);
foreach(
$cat_query->result as $row){}

$cat_id 
$row['AUTO_INCREMENT'];
$site_id "1";
$group_id "4";
$parent_id "0";
$cat_name=$_POST['group_name'];
$cat_title $REGX->create_url_title($cat_name);
$cat_description =$_POST['group_description'];
$cat_image "";
$cat_order "0";

//Creates the SQL query: see http://expressionengine.com/docs/development/usage/database.html
$data = array('cat_id' => $cat_id'site_id' => $site_id'group_id' => $group_id,
 
'parent_id' => $parent_id'cat_name' => $cat_name'cat_url_title' => $cat_title,
 
'cat_description' => $cat_description'cat_image' => $cat_image'cat_order' =>
 
$cat_order);
 
$sql $DB->insert_string('exp_categories'$data);

//echoes the SQL query instead of inserting it - uncomment $DB->query($sql); to make it live.
echo $sql;
//$DB->query($sql);
?> 

A couple of notes: I hard-coded the group_id, site_id and parent_id as well as a couple of other fields, because that’s how I wanted the categories created by users to be. Also, I’m certain there’s a better way to get the next cat_id for the query than using this ridiculous SQL query:

SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name=‘exp_categories’ AND TABLE_SCHEMA=‘your_db_name’ ORDER BY Auto_increment DESC LIMIT 1”);

If you know of a better way, let me know - I’m all ears. In the query, be sure to replace “your_db_name” with your actual database name.

Needless to say, be careful where you use this: you don’t want a spam bot or malicious user coming through and adding a bunch of junk to your categories table.


Posted on Nov 14, 2009 - 07:24 PM

New Cell Phone SMS Phishing Attempt

I got this text message today:

From: 3710

Subject: 003@tmomailnet /  / Message:C

Message: Co-Op-Service: 462562xxxxxxxxxxx-Frozen.Cal 866.360.8725

I googled around, couldn’t find anything similar to this message that anyone had received, nor any message of the 866 phone number.

So, I called it. Turns out that it tells you that your credit card account has been frozen, and that you need to enter your credit card number and a bunch of other stuff in order to reactive your credit card.

This is of course not true.

I’ll try to record the automated 866 number message later tonight.


Posted on Nov 12, 2009 - 09:20 PM

Backing Up Hidden Directories with SpiderOak on Linux

I use SpiderOak as a third-party personal backup service. I use Kubuntu Linux on my desktop, and I started using SpiderOak specifically because it has great Linux support.

Anyway, SpiderOak gives all their users 2GB of lifetime storage, for free. Besides backing up all your regular documents and everything, you can also back up some important hidden directories, including your Firefox bookmarks and profile, and your KDE settings. Here’s how I did it.

First, you need to display the hidden directories in the SpiderOak client, so you can tell SpiderOak what to back up. To display the hidden directories, click the icon which looks like this, circled in red:

SpiderOak Hidden Directories Toggle Button

Once you do that, you should see something like this, assuming you’re looking at your home directory:

Spider Oak Hidden Directories Screenshot

Your Firefox profile, with all your bookmarks and settings in it, is in .mozilla/firefox. If you select the firefox directory and find that it takes up way more of your backup space than you want, and you use Google’s Gears plugin, try unchecking the “Google Gears for Firefox” folder - that trimmed nearly 700 megabytes off the total space I needed to have backed up.

If you use Pidgin, you’ll want to select the .purple folder. This will back up all of your chat logs.

And, if you use KDE, you’ll probably want to back up your .kde folder. (Your .gnome and/or .gnome2 folders if you use Gnome). The .kde folder is where all of KDE’s settings are kept: font sizes, Kwin settings, panel options, saved Kwallet passwords, Dolphin/Konqueror bookmarks, etc. If your hard drive dies and you need to reinstall, replacing your new .kde folder with your backed-up one will make your KDE look and feel just like it did before your crash. One thing to be aware of: if you use Kmail, Kmail stores all of its mail in the .kde/share/apps/kmail folder. Depending on how much mail you have in there, you may want to uncheck .kde/share/apps/kmail so you don’t go over your SpiderOak limit.

Have any other SpiderOak tips, or important Linux config folders that you always back up that I haven’t mentioned? Let me know in the comments!


Posted on Sep 30, 2009 - 06:15 PM

Creative Commons Quercus Lobata/Valley Oak Leaf Scans

I’m doing a website project for my grandfather, Robert Edminster - once I finish it, I’ll be sure to mention it here. To make a long story short, the design involved an oak leaf motif. So, I went outside, picked a small branch from the Valley Oak outside, and scanned them three of the oak leaves that were in the best shape. I’m releasing the original source image as well as a couple of edited/cleaned-up versions of the original image.

I believe these are leaves from a Valley Oak, Quercus lobata, but I could be wrong.

You can download all of the derivations I made of the original scanned image, including the original image and a transparent PNG GIMP .xcf file, here, in a .zip file: oak leaves zip. As well, here are the individual files:

image


Oak Leaf Original


Oak Leaf Transparent Background PNG


Oak Leaves Lightened Original


Oak Leaves Light Background Tile


Oak Leaf Light Background Single

And a single oak leaf, GIMP .xcf source.

Feel free to use these for any project, commercial or non-commercial, under the Creative Commons Attribution-Share Alike 3.0 Unported license. All I ask is that you send me an e-mail letting me know if you do so.


Posted on Sep 25, 2009 - 12:07 AM