Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

Friday, June 12, 2009

Silent install of msp patch

msiexec /p mspfile.msp /qn

Thursday, June 11, 2009

Checking versions if Office 2004 is at 11.5.5 and Acrobat is at 9.1.2

This is a trick to check version of some software on a group of computers


Here we're checking that Office 2004 11.5.5 update is installed


for ((i=1;i < 21;i++)); do if [[ $i -lt 10 ]]; then echo "station $i" ; ssh station-0${i}.local " ls -l /Applications/Microsoft\ Office\ 2004/Updater\ Logs/11.5.5\ Update\ Log.txt "; else ssh station-${i}.local " ls -l /Applications/Microsoft\ Office\ 2004/Updater\ Logs/11.5.5\ Update\ Log.txt "; fi; done

Here we're checking that Acrobat reader and acrobat are at 9.1.2


for ((i=1;i < 21;i++)); do if [[ $i -lt 10 ]]; then echo "station $i" ; ssh station-0${i}.local "system_profiler SPSoftwareDataType SPApplicationsDataType | grep '9.1.2' "; else ssh station-${i}.local " system_profiler SPSoftwareDataType SPApplicationsDataType | grep '9.1.2' "; fi; done

Tuesday, June 9, 2009

How to start another X session

You already have X running and want to run another one.

1. Login into another virtual console
2. Open the terminal
3. startx -- :1

Monday, June 8, 2009

Tricks with the Echo command in XP

rem generate list with echo
for /l %a in (1,1,9) do echo "station-0%a"

rem Generate a file with echo to a room of computers
for /l %a in (1,1,50) do echo "station-%a" > \\station-%a\c$\myfile.txt

Printing from the command line in XP

rem Print from command line


notepad /p textfile.txt

Saturday, June 6, 2009

SVN commands

Creating a new repository for SVN

svnadmin create /path/to/svn/newrepository


Importing

svn --username user import http://svnsite.com/path/to/svn/newrepository -m "initial import"

#note about importing
#create a local folder called newrepository and put whatever code you want to import into newrepository
#run svn from newrepository


Permission denied when importing

# Do this on the server's svn directory

sudo chown -R www-data:www-data svn

Thursday, May 28, 2009

Showing a decimal expansion with bc

#3 digits after the decimal place
echo "scale=3; 41.0 / 939.0" | bc

Wednesday, August 27, 2008

IT Rant II : Disk Imaging

If you have many computers, then you probably dread the time of year where you have to refresh their configurations. There are so many solutions available, but the ones that work and are simple to use are few and far between. Ghost 11 is not one of those programs, and neither is NetInstall for OS X 10.4.11. Ghost 11 would not clone Windows x64 nor regular XP sp3 (it worked for me before with Vista). I have gotten NetInstall to work in the past, but there was some issue with System Image utility failing to copy files. It looks like Apple has done a half ass job of updating OS X once again. I should have upgraded to Leopard server... I guess it's back to my reliable friend disk utility for restores until that happens.

Recently, my disk masters have reached very great sizes -- 100GB and up. This becomes a matter of give and take, because I want to do all my setups on the master. However, by doing so, I am creating images that are far too large. If I have sample files and/or programs that can be copied later, then this is the thing to do. I can copy the files with for loops like so:

Mac -
for ((i=1;i<21;i++))
do
scp somefile mylogon@station${i}.local:samples #make sure you copy the public key from ssh-keygen
done # to each station in ~/.ssh


Windows-
for /l %a in (1,1,20) do copy samplefile.txt \\station%a\c$\samples

There are all kinds of ways to simplify network tasks, but this still doesn't give us an excuse to procrastinate when building disk images. Try and do everything that is to be cloned in the master. Also, try to save space.