Navigation | Throw a Chair!
March 12, 2013
I had some code that looked like this to clear out the temp folder:
NSFileManager *fm = [NSFileManager defaultManager];
[fm removeItemAtPath:NSTemporaryDirectory() error:NULL];
[fm createDirectoryAtPath:NSTemporaryDirectory() withIntermediateDirectories:YES attributes:attr error:NULL];
This used to work. The second call to NSTemporaryDirectory() now returns nil or /var/tmp or something equally different from my app’s temporary directory.
To fix, cache the value of NSTemporaryDirectory
Filed by xtravar at March 12th, 2013 under programming
No comments on this post yet
February 15, 2013
My work is too cheap to spring for a full version of VMWare. Well, that’s not that fair to say – the people who need it get it, and the rest of us get VMWare Player. And honestly, I don’t need it since I rarely use VMs.
Point is: The memory and processor settings are locked in VMWare Player, and my virtual machine was lagging.
Solution:
- Turn off the VM completely. No suspend or save state or any of that jazz.
- Close VMWare Player
- Open the VM’s .vmx file in a text editor
- Change or add the numvcpus key to how many CPUs you want. Ex: numvcpus = “4″ (Keep in mind this cannot be more than your actual machine, I think)
- Change the memsize key to how much memory you wish to allocate. Ex: memsize = “4096″
- Save
- Re-open VM in vmware
This will work with any other settings you need, but those are probably the most useful. Good luck!
Filed by xtravar at February 15th, 2013 under computers, nerding it up
No comments on this post yet
August 5, 2012
I am an advocate of using bleeding-edge software, so I usually don’t turn-tail when things are broken. I just beat my head against the wall until I find a suitable solution. I usually post my solutions here so that other people don’t have to endure my pain.
1. Right click context menus automatically select the first item
The reason this happens is because you moved your mouse ever so slightly when you right-clicked, and the right mouse up event triggers selection.
Unfortunately, I’ve found no fix for this. A lot of people had this symptom with an accessibility feature, but if you never turned on that feature then it’s irrelevant.
Solution: workaround - click faster when you right click.
2. Annoying hot-corners
The upper-left, lower-left, and lower-right corners of the screen activate poppy things that obstruct whatever it is I was doing. When I want spotlight mode, I’ll purposefully trigger it. And I use Cairo Dock for application/window management and notifications, so I don’t need the notification panel – in fact, it often obscures Cairo Dock.
I went to Gnome’s extensions website, and all the extensions that might do what I want are broken (because apparently the API changes so frequently, or another extension is interfering, etc).
I made my own extension, but the Gnome extension reviewers seem poised to reject it.
Solution: Install Disable_Corners@xtravar.org using gnome-tweak-tool or to .local/share/gnome-shell/extensions
3. New windows do not take focus
Since I disabled Gnome’s notifications completely (because they were popping over Cairo Dock), I am not notified of new windows. Plus, when I open a new window, damnit I want it on top.
This one’s easy.
Solution: Open dconf-editor. Check org.gnome.desktop.wm.preferences.auto-raise
That’s all for now. I’ll keep this updated as more things annoy me.
Filed by xtravar at August 5th, 2012 under Uncategorized
1 person have commented this post
July 4, 2011
I was running a Wiki Bot on a Dreamhost hosted website. This was the error I received:
ModSecurity: Multipart parsing error: Multipart: Final boundary missing.
Turning off “added security” in the Dreamhost Panel helped a little bit, but I’m still occasional errors.
Filed by xtravar at July 4th, 2011 under Uncategorized
No comments on this post yet
June 13, 2011
BACKGROUND
With SSD drives, this is going to become more and more of a problem until their capacity gets ramped up. We must manually select what we want on the drive to be fast, and put the other stuff on a cheap, large-capacity, mechanical drive. However, Windows and Windows applications make this very difficult.
For the purposes of this example, I will use Steam. Steam places games in “C:\Program Files (x86)\Steam\steamapps\common\”. Games can be pretty large. So when you get to the limit, you have to delete one of the installed games. For me, this is around 4 or 5 modern games, so it’s not very convenient. There’s a longstanding request on the Steam forums to address this functionality, because you can only install games to the drive Steam is on… or can you?
Windows Vista introduced symbolic links. They’re a feature that other operating systems have had for years. Prior versions of Windows could make “junction points”, and you can find that application if you’re using XP or lower, but for the purposes of this post we will talk about this new feature since junctions can cause unforeseen issues – particularly with system files.
LONG EXPLANATION
A symbolic link allows you to map a directory or file in one place to another without any applications understanding that it isn’t in the place they think it is.
So let’s say I want to put Borderlands – a 12 GB game – on another drive because I won’t be needing fast loading times since I already beat it. I would move “C:\Program Files (x86)\Steam\steamapps\common\borderlands” to “D:\steam\borderlands”. Now, Steam cannot find it.
The next step is to open an Administrator command prompt (type cmd into the Start Menu search, right click on command prompt, and go to “Run as Administrator”).
mklink /D "C:\Program Files\ (x86)\Steam\steamapps\common\borderlands" "D:\steam\borderlands"
Now Steam will be able to find it! If new DLC comes out and you’ll be playing more often, delete the symbolic link (the folder in steamapps) and move the folder back where it came from.
At some point I might make an app to automate this. Enjoy!
TL;DR
- Move the folder elsewhere.
- mklink /D [FOLDER] [ACTUAL FOLDER]
Filed by xtravar at June 13th, 2011 under gaming, nerding it up, steam, windows
No comments on this post yet
May 9, 2011
I’m putting this up mostly because I was looking for pics and they didn’t exist. So in case you’re wondering what kind of heatsink to buy for your Radeon HD6870, here are installation and finish photos. I had to mod my case because the heatsink takes up too much space.
Link to gallery.
Filed by xtravar at May 9th, 2011 under computers, nerding it up
No comments on this post yet
September 15, 2010

ApplicationsMenu is my first Cairo-Dock applet. It is written in C# and requires Mono, NDesk.DBus, and libgnome-menus.
Its goal is to emulate the Mac OSX applications menu as much as possible with the API provided.
You can download it here: ApplicationsMenu Cairo-Dock Applet v0.0.1
The source contains multiple useful components:
1. A (beautiful) C# wrapper for the Cairo-Dock DBus API.
2. A wrapper for libgnome-menus
3. Modification of some C# Diff code I found online.
You can download the source here: ApplicationsMenu Source v0.0.1
Hopefully this is useful to someone else, as either an applet or example code.
Filed by xtravar at September 15th, 2010 under linux, programming
No comments on this post yet
September 21, 2009
Even though the PS3 Hulu experience kind of sucked, I kept hoping it would get better after each System Update. Until… Hulu banned the Playstation 3 browser. The message they give is “This video is not available on your platform”.
I could go on a tirade about this, but instead I will just arm you with the knowledge you need to solve this problem and do what they don’t want you to. The basic steps are:
- Set up a HTTP proxy that rewrites the User-Agent string
- Configure Playstation 3 network settings to use this proxy
- Watch Hulu on PS3.
Naturally, I chose to expand my file server/router machine’s job by installing Squid 3.0 (proxy software), though you can set up any HTTP proxy on any machine on your network so long as it is capable of rewriting the User-Agent header.
Be warned, though, if you use Squid that there is a lot of conflicting information out there since they changed the configuration directives across versions. In Squid 3.0, merely add this to your squid.conf:
request_header_access User-Agent deny all
header_replace User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; YPC 3.0.1; .NET CLR 1.1.4322; .NET CLR)
That User-Agent string is for IE7. You may wish to change that to another common browser, or add a “Fuck you, dickheads” to it, but as long as it doesn’t say “PLAYSTATION 3″ then you should be fine.
Filed by xtravar at September 21st, 2009 under linux
No comments on this post yet
August 15, 2009
Open up /etc/shorewall/rules in your favorite text editor (nano) as root. Add this line (and replace 192.168.0.2 with your ‘DMZ’ computer):
DNAT net loc:192.168.0.2 all
The confusion stems from the fact that most consumer-grade hardware routers consider the DMZ to be “the place where I forward everything.” Drove me nuts trying to figure this out, so hopefully this will help you.
Of course, to guarantee that your computer has that IP address when using DHCP, you must add to /etc/dhcp.conf the following:
host hostname {
hardware ethernet [MAC address] ;
fixed-address 192.168.0.2;
}
Disclaimer: All I know about Shorewall and networking are enough to get me by.
My file server/router is almost complete!
Filed by xtravar at August 15th, 2009 under linux
No comments on this post yet
May 3, 2009
If you found this post with a search for those particular keywords, this post may help you figure out what you’re trying to achieve, regardless of what I was trying to achieve, so I wouldn’t automatically dismiss this after I describe my setup.
Here is my configuration:
- Mandriva Linux x86-64
- Gnome desktop
- Two similar nVidia cards with two DVI ports on each: 4 total DVI ports
- Two LCD panels of similar dimensions and a LCD TV: 3 total displays
Here is what I wanted to achieve:
- All displays working at same time, but not necessarily as one large display (no Xinerama necessary)
- Compiz graphics (no Xinerama)
- gnome-panel spanning one display
Now, from a clean install of Mandriva, all I need to do is run nvidia-settings, turn on TwinView for my two matching panels, and everything is perfect… except for the TV. If I attempt to enable the TV as a separate X screen, point #3 fails. It doesn’t make any damn sense, but that’s what happens. Applications sometimes still maximize to separate monitors (and sometimes don’t depending on my configuration – a lot of this is black magic to me).
It turns out that libgdk determines how things maximize and such. Each display has a number of screens, and each screen has a number of monitors. The maximization/panel logic apparently goes off of the monitors.
So what I did is I downloaded the gtk+ source RPM, dug around, and found the init_multihead function. With a little fooling around, I now have hacked the code to look like this:
if(screen_x11->screen_num == 0)
{
screen_x11->n_monitors = 2;
int nWidth = WidthOfScreen(screen_x11->xscreen) / 2;
screen_x11->monitors = g_new0(GdkX11Monitor, 2);
init_monitor_geometry (&screen_x11->monitors[0], 0, 0,
nWidth,
HeightOfScreen (screen_x11->xscreen));
init_monitor_geometry (&screen_x11->monitors[1], nWidth, 0,
nWidth,
HeightOfScreen (screen_x11->xscreen));
}
else
{
/* No multihead support of any kind for this screen */
screen_x11->n_monitors = 1;
screen_x11->monitors = g_new0 (GdkX11Monitor, 1);
init_monitor_geometry (screen_x11->monitors, 0, 0,
WidthOfScreen (screen_x11->xscreen),
HeightOfScreen (screen_x11->xscreen));
}
That’s pretty much it. Keep in mind that you need a few dependencies to build GTK, so install the corresponding -devel RPMs. If you’re not using an RPM-based distro, you probably know how to patch stuff already. I didn’t bother building a new RPM, I simply ran ./configure –prefix=/usr and then make, and replaced the original one after making a backup.
A three-monitor TwinView setup will work fine (for GTK apps, at least). To run stuff on the other display, use gnome-terminal –display=:0.1 or run export DISPLAY=:0.1 before running your app. Now I can watch TV without restarting X, hooray!
Filed by xtravar at May 3rd, 2009 under linux, programming
No comments on this post yet