Friday 14 October 2011

Apple - Firefox Unix Scripts

A few useful UNIX scripts to push out with Apple Remote Desktop.

Kill Firefox
killall -9 firefox-bin

Remove Firefox
rm -rf /applications/firefox.app

run these as root


Its good to use these before you install a newer version of firefox on the apple mac, and also goes well with my other blog about making Firefox have default settings. http://adamwaycomputing.blogspot.com/2011/10/firefox-default-settings.html

Thursday 13 October 2011

Apple - Firefox Reset

Using Firefox on the apple macs we find that a lot of the time it gets stuck "open" or sits in the dock bouncing.

"Close Firefox

A copy of Firefox is already open. Only one copy of Firefox can be open at a time."

We want to help our users help them selves as it saves us time and them time!

So I wrote this apple-script that will reset Firefox back to default for the user.

So here goes!

On the apple mac open up script editor, copy this in.


tell application "Finder"
    if exists folder "Profiles" of folder "Firefox" of folder "Application Support" of folder "Library" of home then
        -- it exists, do something
        tell application "Nightly" to quit saving no
        tell application "Finder"
            delete the folder "Profiles" of folder "Firefox" of folder "Application Support" of folder "Library" of home
            delete the folder "Firefox" of folder "Caches" of folder "Library" of home
        end tell
        tell application "Finder"
            delete the file "profiles.ini" of folder "Firefox" of folder "Application Support" of folder "Library" of home
        end tell
        display dialog "Your Firefox Profile has been reset.

Please Re-open Firefox!" buttons {"OK"} giving up after 300
    else
        --it doesn't exist, do something else
        display dialog "You dont seem to have run Firefox yet!
               
Please run Firefox again!

If you are still having problems
Please call IT Support!" buttons {"OK"} giving up after 300
    end if
end tell

it will look like this,
 Now go to Files --> Save As

Give it a name and click save.

A Super Big Warning

When you run this it will reset your Firefox settings so please either backup all of your settings or do it on a machine / profile that you don't care about. You have been warned! :-D


Yes there are probably better ways of doing this, and yes it can probably be refined, but this works for me so im not gonna change it :-D

If you combine this with my Firefox Default Settings blog then you can make a very streamlined experience for the user.


Wednesday 12 October 2011

Apple - Firefox Default Settings

We are going to make Firefox, for the mac, load up with custom settings for users.
You may ask why we would want to do this, well if you work as the IT Admin for company / school / college, you will know that you can customize the settings for IE via Group Polices (GPO) on the pc's.
You can use Workgroup Manager on the mac to configure Safari.

Chances are you want to roll our Firefox but the boss wants you to have some control over the settings, eg Homepage and getting rid of all those pesky questions it asks you.

First off we need to download the file so head over to http://www.mozilla.org to download the latest version.

Once its downloaded mount the file and drag the Firefox.app file to your desktop.

Next we will get rid of the import settings screen as we dont want to do this.

Open text edit and type in;

[XRE]
EnableProfileMigrator=false
Save this file with the name override.ini


Right click Firefox and click Show package contents
A new finder window will open, click contents --> macOS
now copy this override.ini into the macOS folder.



Now lets create some default settings for our users.

Right click Firefox and click Show package contents
A new finder window will open, click contents --> macOS --> Defaults

create a new folder called Profile

in this we are looking to create the "standard" profile settings.

at the least we will make a file called user.js

Open textedit and enter this into it

user_pref("browser.bookmarks.restore_default_bookmarks", false);
user_pref("browser.places.smartBookmarksVersion", 2);
user_pref("browser.rights.3.shown", true);
user_pref("browser.startup.homepage", "www.homepage.co.uk");
user_pref("network.cookie.prefsMigrated", true);
user_pref("privacy.sanitize.migrateFx3Prefs", true);
user_pref("network.proxy.type", 0);
user_pref("general.smoothScroll", true);
user_pref("browser.startup.homepage_override.mstone", "rv:7.0.1");
user_pref("app.update.enabled", false);
user_pref("browser.search.update", false);
user_pref("extensions.update.enabled", false);
user_pref("toolkit.telemetry.prompted", true);

If you want to know what settings need to be entered for your situation, open up firefox as a user, making the setting changes and closing firefox.

open a new finder window, go to the users home area --> Library --> Application support --> Firefox --> Profiles --> RANDOM.default



in here there is a file called prefs.js

this will contain all of the new settings that have been set. i.e proxy server, homepage etc...

open this and find the setting you have set and you can copy and paste these to the user.js that is within the package.

I got a bit more advanced and i included the latest ad-block add-on with it as i don't want our users to get bothered by hundreds of adverts, this also help keep them focused on the task at hand.
All you have to do it put anything you want EVERY user to get into the /defaults/profile folder.

Thursday 18 August 2011

Server 2008 R2 - Enable Ping Responce

By Default Windows Server 2008 does not respond to ping responses, this can often lead to confusion and thinking that your server has a connectivity problem as so many of us simply use the ping command to check if we can talk to a server.


Lets turn it back on.

Click Start --> Administrative Tools --> Windows Firewall with Advanced Security


Click on Inbound Rules
 Scroll down and find, File and Printer Sharing (ECHO Request - ICMPv4-In) and double click on it.
 Tick the box in the middle "Enabled" and then click OK
 You will now notice that you have a nice happy green tick next to this rule and your server can now respond to ping requests.

This can also be set via GPO to cut down on admin effort and also this will cut out human error and forgetting, please see my guide here.