Posts Tagged “software”

SaveMedia.dll causing issues with Playfire and CorsairLink

Just recently had this issue, programs crashing and reporting
Faulting module name: SaveMedia.dll, version: 1.38.0.0
in the event viewer.Turns out it's an issue with RivaTuner, I added both Playfire and CorsairLink to the application list in RivaTuner and choose 'None' on the 'Application detection level'.Seems to have fixed the issue.

Mount CIFS Unsecured Windows Shares Arch Linux

I was trying to mount a samba share from ArchLinux, this share is unsecured, with a username of guest.I tried a range of options
mount.cifs -o guest //ip/hdd /mnt/hdd
mount.cifs -o username=guest //ip/hdd /mnt/hdd
mount.cifs -o username=guest,password= /ip/hdd /mnt/hdd
Plus a bunch of other iterations and I kept getting
mount error(13): Permission denied'
After a bunch of searching I found a post that said you sometimes need to include sec=ntlm, and with this I got it to work
mount.cifs -o username=guest,sec=ntlm //ip/hdd /mnt/hdd

Uploading multiple LCOV and JUnit XMLs for the same source to Grunt-Karma-Sonar

I recently needed to upload 2 LCOV files, and 2 JUnit XML files up to Sonar. The problem was both LCOV and JUnit XMLs covered the same JS source files, so if I'd configured grunt-karma-sonar like normal, with the JS source path in the 'path' option, Sonar would throw an error about duplicate source files.So I comment out the 'path' option for the second set, but then the LCOV file has the wrong path when it gets uploaded to Sonar, meaning Sonar doesn't count those coverage results.Read more...

Hacking Proxy support into Brackets

Started using Brackets at work, though they use a corporate proxy, so I did a quick hack to get proxy support into Brackets for installing Extensions.

Update:
Version 0.41 and above you can define the proxy in the Preferences file, in Brackets go Debug -> Open Preference File.
Then add a line
"proxy": "http://localhost:3128",Read more...

Facebook Javascript API - Post to wall - FB JS SDK

Working with the Facebook JS SDK I was having problems using the FB.ui to log the user is, and post a message to their wall. Main error was 'Permission denied to access property 'Arbiter'.'. I tried many different things such as developing this on a website that could be accessed from external sources, but the problem wouldn't go away.


So I wrote some code that used FB.login and FB.api, though after login/permission acceptance it would leave the XD Proxy window open on a blank page. Below is my code which will handle the XD Proxy window, login, permission acceptance and post to their wall, even on your local environment without external sources being able to access your site.


First we install the FB API


<script>
window.fbAsyncInit = function() {
FB.init({
appId : facebookAppId,
channelUrl : 'http://'+ window.location.host +'/channel.html',
status : true,
cookie : true,
xfbml : true,
oauth : true
});
};

(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>


Next we want to setup the function to handle the login/permissions.


function FBShare(title, link, picture, msg, caption) {
FB.login(function(data) {
postFBMsg(title, link, picture, msg, caption);
}, {scope: 'publish_stream'});
}


Here I call FB.login, setting scope to publish_stream which once the user is logged in will ask for permission to allow my app to publish to their wall.
Once login is complete and they have accepted my permissions, we call postFBMsg.


function postSocialMsg(title, link, picture, msg, caption) {
var body={
message: msg,
picture: picture,
link: 'http://'+ window.location.host +'/'+ link,
name: title,
caption: caption
}

FB.api('/me/feed', 'post', body, function(response) {
if (!response || response.error) {
// Error
} else {
// Successful
}
});
}


Here I set the body var to contain our Facebook Wall Post details, we have the title(Don't Worry Be Happy) which will be linked to link, we have picture(Guy Sebastian pic), msg(Wall Post Message) which will appear under the Username(John Smith), title and caption(Guy Sebastian) which will appear under our Message to the right of the picture. If no Caption is sent it displays the link URL instead.


The final piece to our puzzle is to handle the closing of the XD Proxy window after login. It posts back to the calling window after actions are performed, I setup an event to capture these messages and close the window once it receives one. If you already are using postMessage between windows, you'll need to setup a conditional statement to only close the window if it's a Facebook message.


 $(window).bind('message', function(e) {
e.originalEvent.source.window.close();
});


So once we get a message via postMessage we close the window of the message sender.


This is how I'm doing it in my local development environment, inaccessible to the outside world, if you spot and flaws, or know of a better way of doing things please leave a comment.

Firefox 9.0.1 Error: uncaught exception: TypeError: args.shift() is null

So looking at a site we're developing this morning in FF 9.0.1 and some pages didn't work on some peoples machines, though worked fine on mine. After installing Firebug to see what was going on the pages would work fine.

I uninstalled Firebug and looked at the Firefox Error Console to find the following error.
Error: uncaught exception: TypeError: args.shift() is null


Was a weird one, after much poking around I found it's a poor handling of arguments supplied to console.log, hopefully this is a bug in FF9.0.1 and will be corrected in the next release. For now to quickly get things working I've just extended my console.log handler to set console.log=function() {} to cancel console.log functionality until it's fixed.

If it's not addressed in future versions I'll have to look into it further to detect if Firebug isn't active and do some alternate handling for development.

To work around this I've changed my code to this
if(window.location.search!='?debug=1') {
top.console.log=function() { }
}

Now I just add ?debug=1 to URL and it uses built in console log so I can manage when it comes on.

Hope this helps, if you have further info please leave a comment.

Dungeon Siege III - GFX Files

GFX files are basically SWFs, to edit them rename them to a *.swf file and with a hex editor change the first 3 bytes from CFX to CWS, then any Flash Decompiler will happily open them.

I've opened them up and inspected the Actionscript which all worked though I'm yet to try editing one, my guess is you should just be able to change the first 3 bytes back to CFX and rename it back to an *.gfx file for it to work, though depending how it modifies the SWF it might break something extra that GFX files have that SWF doesn't.

Let me know if you've had any success, or more info, I'll update this post as I find out more.

Dungeon Siege III - Enable Console

So just bought Dungeon Siege 3 and was horrified with the unchangeable camera angles. So I set about having a dig around the game to try and find a way to change the camera, while digging around I noticed a console file, and the Dungeon Siege III.exe had a number of console commands in it, so I replaced the Help Topics file with the Console, so now when I'm in game I can press Esc, click 'Help Topics' and the console will appear.

After playing around with all the console commands I could find in relation to camera none seemed to have any effect, though most other console commands works, such as adding money, items, XP, levels etc. So cheating is easy in Dungeon Siege III, but changing the camera angles isn't )-: Hopefully I'll have more time to play around with them and work something useful out.

The easiest way to activate the console on your version is by downloading the gui.zip file from http://www.mediafire.com/?sa7a3gepx3ea4f5, then extract the 'gui' folder from gui.zip into %steamapps%\common\dungeon siege iii\data\. Now start Dungeon Siege 3, and when in-game, click 'Help Topics' from the menu to access the console. You'll need to watch the video at 720 to read the names.

If the above video instructions didn't work for you, here are the manual steps.

I grabbed the Dungeon Siege 3 OAF Files Extractor and unpacked the files to a temp directory, unpack data_archive.oaf first, then unpack data_archive_2.oaf into the same place, the files in data_archive_2.oaf overwrite some which is how the game works too.

After looking around my first step was to get console working, I copied gui\console.scn and gui\game.gui into %steamapps%\common\dungeon siege iii\data\gui

Rather than having to repack the archives after editing just drop the files you changed here and it will pick it up rather than using the archived copy.

Now rename console.scn to help_topics.scn and edit game.gui. Find the line
help_topics.scn   parsefunction GUI_command_parser_help_topics
Change to
help_topicx.scn   parsefunction GUI_command_parser_help_topics

Then find the line
console.scn   parserfunction GUI_command_parser_console   game_flags  1
Change to
help_topics.scn   parserfunction GUI_command_parser_console   game_flags  1

Orange signals what was changed for ease of reading.

Now run the game, while in game press Esc, in the menu click Help Topics and you'll have access to the console.

To get back to the game type modal_close_all and press enter. You can also type mod and press TAB to auto-complete. As we've hacked the console into an unusual place, things don't appear in it's history straight away, so if you press top_down_mp_ and press TAB, because there are multiple options it won't display anything. After you have pressed TAB, just delete the text and type modal_close_all, then enter the console again and you'll now be able to see the options for your previous commands, so we'll see all available options for top_down_mp_ console commands.

I'll add the console commands and explanation here slowly as I find them, though I can't test them all so some might not work, let me know if you find more, descriptions are wrong or they don't work and I'll update this list.

avoidance_scale
avoidance_range
avoidance_count
avoidance_collection_range
avoidance_collection_interval
avoidance_sideways
avoidance_active
ai_attack
aggro_decay_rate
ai_draw_perception_radius
avoidance_when_stopped
area_notification
area_notification_duration
add_money - Add money to your character
add_xp - Add XP to your character
ai_enabled
add_to_party
ai_revive_debug
ai_loot_pickup_delay
ability_bind
ability_purchase
ability_dump_all
ability_dump
auto_grant_empowered_attacks
ability_autoassign
attract_enable
allow_auto_level_up
allow_skip_level_up
attract_movie_name
attract_movie_delay

batched_lighting
brightness
base_stats_print

combat_knockback_duration
combat_knockback
combat_friendly_fire
combat_damage
combat_print
contrast
con_queue_disable
companion_perception_buff
connection_reset
changelevel
combat_hard_threshhold
companion_alternate_cooldown
camera_remote_interpolate_dist
camera_shared
critical_override
camera_center_on_object
camera_mouse_sensitivity
console_close
console_toggle
console_open
camera_auto_rotate_deadzone
camera_auto_rotate_scale
camera_yaw_max_velocity
camera_yaw_damp
camera_yaw_speed
camera_recenter_delay
camera_multiplayer_control
cost_divider_for_enchant
credits
clear - Clears all previous console output

exec - Run console scripts, located in global\console_scripts\*.txt Eg: exec global\console_scripts\bad_ass
endgame_disconnect

fade_draw
fade_aggressive
find
float_text
float_text_exp_y
float_text_exp_x
find_games_receive_invites
find_games_party

gui_delay_load_sleep
gui_delay_load_name
gui_mem_report_detailed
gui_mem_report
get_global_variable
gui_resource_dump
gui_trace
gui_timescale
gamma
give_unlockable
gui_warning
god - Toggle God mode on player
getpos
game_mode_reset_on_exit
game_mode
gui_quest_filter
gui_split_screen
gui_ingame_character_select
gui_show

human_attack_bias
heal
hide_spinner
hud_fade_duration
hud_show_names

infinite_resource
interpolation_tolerance
if
item_spawn
inv_drop
item_print_by_id
item_print_by_tag
inv_print
inner_warmth_time
inner_warmth_dmg
inner_warmth_hp
ingame_scn_mp
inv_mark_viewed
inv_show_remote_companions
inv_show_remote_players
inv_show_defaults
ingame_screen_fade_duration

journal_load
journal_save
journal_play
journal_stop
journal_record

knockback_prediction_hold
kick
kill

load_art_objects_only
load_game_objects
level_debug
load_spinner_delay
loot_spawn_from_template
loot_random_spawn_from_template
loot_print_template
level_up_delay
level_scaling_dlc
level_scaling_difference_threshhold
level_scaling_target_range
level_scaling_enabled
loading_screen_fadeout_duration
load_full_party
loot_points_per_enchant
load_level_filter
load_level_test

max_combat_channel_dist
mission_open_list
mission_list
mission_set_end_state
mission_set_status
max_auto_target_ui_dist
multiplayer_remote_enabled
multiplayer_local_enabled
modal_close_all
multiplayer_stuck_warp_delay
multiplayer_tether_range
max_players
multiplayer_ai_idle_time
multiplayer_tether_others
multiplayer_remote_warp
multiplayer_tether_screen
minimap_enabled - Show/Hide minimap, top right.
minimap_scale - Change level of zoom used in the minimap.
minimap_rotate
minimap_yaw
minimap_alpha
main_menu_load_level
main_menu_credits
main_menu_dlc
main_menu_find_game
main_menu_continue
message_box_ok

net_interpolate_max_stopped_time
net_extrapolate
net_interpolate
net_position_offset_z
net_position_offset_y
net_position_offset_x
net_activation_delay
net_predict_knockback
net_predict_reaction
net_ip
net_port
net_loopback
new_game_data

objective_set_status
objective_list
overheal

projectile_impact_fx
platform_speed
platform_accel_dist
path_blocker_disable_all
platform_predict_movement
play_anim
player_additive_speed
player_min_health
player_damage
platform_delay
pause
party_add_xp
party_set_level
party_restrict_class
party_single_player_limit
party_default_companions
player_ai
player_name_from_class
player_add
player_level
print_loyalty
player_class
popup
post_charselect_new_game_data

quit -Quit game completely, back to Windows.

render_csa
reset_tutorial
render_hit_flash
rumble
revert
revert_all
respawn
retry
reconnect
rcon
restart_server
respawn_interval

script_list
script_run - Runs AMX files located global\scripts, followed by the function name and arguments. Eg: script_run global\scripts\00_intro\00_intro CamShake will result in the screen shaking once you modal_close_all. I haven't looked into AMX files yet, will do a follow up post once I find more out.
set_light_set
set_global_variable
stats_print
speedy
show_all_damage_numbers
subtitle_notification
seek_fullscreen_movie
stop_fullscreen_movie
start_fullscreen_movie
status_effect_apply_to_player
scale
set_level
set_resource
set_health
status
startcell
startlevel
startlevel_data
stream_proximity_radius
survival_creature_set
say
start_conversation
screen_shake_move_camera
session_type
save_load_enabled
show_spinner
save

timeline_reload
toggle_tutorial
tutorial_enabled
toggle_pause
target_ui_neutral_player_index
target_ui_hostile_player_index
target_ui_neutral
target_ui
top_down_mp_fov
top_down_mp_distance
top_down_mp_pitch
top_down_yaw_offset
top_down_collision_mp_pitch_speed
top_down_collision_mp_decay
top_down_collision_mp_hold
top_down_collision_mp
top_down_collision_sp
top_down_zoom_all

unpause
unlock_all
user_setup_delay

warning_notification
write_file
warp_to_player
warp_to_position

 yaw_offset


ASCII Art in IE8 64bit exe

I was hexing the exe and noticed some patterns, few tries of different width settings and these embedded ASCII art images became available.

Image 1

Image 2

Image 3

MDBTools - Currency field blank in CSV

We use MDBTools to convert an Access DB to CSVs to import into MySQL. Moving a site to another server we tried installing MDBTools via YUM, but continued getting Segment Faults each time we ran mdb-export.
So we downloaded the source and recompiled, everything seemed to work, except the currency column was blank in the CSV. All other types worked, just currency appeared to have a problem.

I did a ldd on mdb-export on the old server that worked and compared to ldd on the new server, and noticed some differences, so I decided to try the RPM avaliable for download at the mdbtools SF page.

On a rpm -i it complained that 'libreadline.so.4 is needed by mdbtools-0.5-1.i386'
I did a yum list readline* and found
readline.i386                            5.1-1.1                installed
Available Packages
compat-readline43.i386                   4.3-3                  base

So I rpm -e mdbtools, yum install compat-readline43.i386, and rpm -i mdbtools from SF.

Now mdb-export correctly exports the currency fields to CSV.

USBee SX Logic Analyzer

I've been playing with my USBee SX Logic Analyser. Physically the unit is nice and small, the hooks are easy to use. Unfortunately both the Suite software and the SX software crash when trying to Capture more than 200M samples in the buffer. I have used the Suite software to capture the SPI signals between a MMC card reader and the MMC card, the SPI decoder worked brilliantly. Would like to be able to reduce the text size, it shows the hex of each byte is quite large letters which means I can't fit many bytes onto one screen wide, and the scrolling is a bit troublesome. Would be great to have a the mouse wheel scroll, rather than zoom, as left/right clicking zooms in/out. Maybe even using the Page Up/Down to scroll larger chunks.

I have just now tried to SPI decode a 20second capture, with maybe 6 bytes of SPI traffic and it keeps crashing on me. I saved it when I first captured it, being use to regular crashes by the software. But even once I reopen it and try and set the SPI decoder up again, gets part way through and hangs, just keeps taking up RAM until at about 1.5gb Windows kills it.

When the software works this is a really nice system, with the above tweaks it would be awesome.

I've let USBee know about the problems, see how long it takes for them to get back to me.

Vuze/Azureus Speed Scheduler Plugin

Most ISPs give you a different amount of bandwidth for Peak and Off Peak times. Mine is 9am to 1am is Peak, 1am to 9am is Off Peak. Given I'm not up at 1am to turn my torrents on, or raise the minimum download speed I searched around and found a brilliant plugin called 'Speed Scheduler'. It let's you define different time periods and set Max Up and Down speeds for this time preiod, or pause uploads or downloads all together.

I did have to set 2 rules, one from 9am to 11:59pm and another from midnight to 1am, these 2 rules have a minimum download of 7kib/ps, which means I just have enough Peak quota to make the month when combined with my other browsing. And all my torrents run full speed just in Off Peak times, allowing my to utilise most of my Off Peak quota too.

In Vuze, goto 'Tools'->'Plugins'->'Get Plugins' and it will be downloadable from the website.

Update:
I've been using uTorrent for a while now, it's much better than Vuze, smaller memory footprint and an easy to use scheduler built in. I'd recommend trying it out.

2nd Greasemonkey Script for Wesabe

Edit: With Wesabes interface update script no longer works.

Read about Wesabe in my first scripts post

When you do a search for a tag I wanted it to calculate if you were spending more or less than you were earning. So I wrote this little script. I am pulling out dates along with each tag. I would like to graph each spend/earn eventually like on the Accounts page but I couldn't figure out how to tap into the graphs that Wesabe already use.

While the script can handle case differences in the Tag used on the transaction and the tag searched for, it can't handle more than 1 search tag. This is another feature I'll be adding soon. Most likely before graphing.

Here you will see my transactions, $5 is added to the Ent tag through the use of Splits.


And here you will see it has added together all spending and all earnings for the searched tag.

Greasemonkey Script for Wesabe.com

Edit: With Wesabes updated interface this script no longer works.

For those who don't know, Wesabe is an online basic financial management tool, takes direct exports from most banks and lets you apply tags, which can be used to track Earnings vs Spendings and help you budget. It is also a community when you can talk with others and provide tips about certain places you shop, which can then be seen by others who shop at the same place as you. These tips seem mostly USA based, but it's a good idea.

With Tagging, you can give multiple tags to a certain transaction, and assign certain amounts to each tag, so say a $220 transaction was logged, you could tag Food with $100 and Clothing with $120, must have been my Wifes shopping day.


While this is simple, I found when I budgeted I'd move a large amount of money around, which related to many tags, and as I typed them in I had to keep adding each one to a running total to make sure it matches the total amount in the end. So I created this Greasemonkey script to do it for me, now it adds a little box next to each one with a running total of all your tagged amounts.



Download Script: http://userscripts.org/scripts/show/33701

Find which site 'spamd child' has high CPU usage in Ensim

The CPU utilisation report for one of our servers was higher than expected for months, I had some time to delve so I wrote the following script from info I found on the net, I don't fully understand the code, so if there is a better way of doing it let me know.
In the /etc/crontab I entered the below to run every minute
*       *       *       *       *       root /home/logCPU.sh 2> /dev/null

And in /home/logCPU.sh
#/bin/sh
echo '------------------------------ ' `date` ' -----------------------------' >> /home/logCPU.txt;
ps auxr --sort=-pcpu >> /home/logCPU.txt;
pids=$(ps auxr --sort=-pcpu | awk "/ $1/ { if(\$3>1) printf \"%d,\", \$2 }");
lsof -p `echo $pids` >> /home/logCPU.txt

Each minute where no CPU is utilised you'll see
------------------------------  Tue May 13 10:56:01 EST 2008  -----------------------------
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 462 0.0 0.0 0 0 ? D< May07 0:44 [kjournald]
root 26177 0.0 0.0 2164 824 ? R 10:56 0:00 ps auxr --sort=-pcpu
apache 26178 0.0 0.1 19596 4300 ? R 10:56 0:00 php -f a_script.php

When a process has a CPU usage it runs lsof, as the spamd child example below
------------------------------  Tue May 13 10:57:01 EST 2008  -----------------------------
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
22309 26314 1.8 0.9 39332 34916 ? R 10:56 0:00 spamd child
apache 17029 0.2 0.6 47196 24604 ? D 10:21 0:04 /usr/sbin/httpd
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
spamd 26314 22309 cwd DIR 9,0 4096 79103114 /home/virtual/site27/fst
spamd 26314 22309 rtd DIR 9,0 4096 79103114 /home/virtual/site27/fst
spamd 26314 22309 txt REG 9,1 14788 648405 /usr/bin/perl

This shows that it is site27 running the spamd process. You can let this run for a few days and see which sites are utilising too much CPU% because of SPAM, then see if you can optimise the site email and spam filtering, by maybe removing highly spammed accounts, turning off SPAM filtering if it can be easily picked up by the local mail client etc.

By removing 4 old email accounts from one particular site we reduced the server from a 24hr load average of 2 to about 0.6, the 5 minute average was hitting 8 at times, now it hits about 3 during the backup.

This script can also help you track down what is using CPU resources at a particular time.

Fix '*mb of free virtual memory' on 'Director Player 6.0' and 'Director Player 5.0' programs on XP/Vista

I'm getting 100+ people look at this each month, seems like tons of people still use these old Director programs. If this doesn't help you, please leave a comment and let me know what you were looking for and maybe I can help.


I tried to play an old pool game today, when I ran it an error popped up saying 'Director Player 6.0', 'This program requires at least 3mb of free virtual memory to run.'


I did a search on the net and found that when Windows moved from 98 to XP the way it reported Virtual Memory amounts was changed from bytes to kilobytes, which leads Director 6.0 to think that there is less Virtual Memory than there really is.
Most fixes revolve around setting your Virtual Memory under 1GB or 4GB+, which is a lot of messing around just to play an old game.


I opened IDA Pro and had a squiz, found the culprit and disabled it, I am not sure if the byte I changed is in the same place on all Director 6.0 games, or if the calls made before the byte I changed are the same, so I can't make a patch to change this automatically until I know these things, if you have another Director 6.0 program that is reporting this error send me the exe and I will see if I can release a patcher to fix this in all Director 6.0 exes. The call before it seems to be the same for Director Player 5 and 6 so I have made a patcher that seems to work on both Director Player 5 and 6.

call ds:GlobalMemoryStatus
mov eax, [ebp+Buffer.dwAvailPageFile]
add eax, [ebp+Buffer.dwAvailPhys]
cmp eax, 387520h
jge short loc_40D3B2

or in a hex editor
FF 15 F4 AA 53 00 8B 45 84 03 85 7C FF FF FF 3D 20 75 38 00 7D 6E

I changed jge (0x7d) (Jump if Greater or Equal) to jle (0x7e) (Jump if Less or Equal) as Rene pointed out change it to jmp (0xEB)(Jump)
In my game it was located at 0xc742

To find 0xc742 in FRHED, look for the Offset in the bottom left.

Each set of double numbers/letters is a byte displayed in HEX, each byte adds 1 to the Offset

Thanks to Gerard for the comment about Director Player 5 having the same byte sequence.

Patch
I've made a new patch, should work on Director 5 and 6 programs, and from my limited testing it works. If you have a Director 5 or 6 program that this patch doesn't work with please send me just the exe file and I'll test it and try and update my patch to allow it to work. Some people have reported this patch get's falsely marked as a Trojan, it's not but uses a packing method that some Trojans use. If this happens to you and it you can't tell your anti-virus solution to ignore this file download the unpacked one, though this hasn't been tested, let me know if it works for you.

http://www.mediafire.com/file/acca0blw7tlr3gc/DirectorMemPatch.exe

http://www.mediafire.com/file/ltfik2pefd1ngrv/DirectorMemPatchUnPacked.exe

Edit:
Hex Editor I recommend - Frhed http://frhed.sourceforge.net/