Greg's Page of Useful Pot-Pourri

From tigwiki

Jump to: navigation, search

Contents

[edit] Who/What/Where/When/Why/How in the hell do I ...

This page here has a bunch of hyperlinks, including useful links to commonly-needed TRIUMF resources, groups, people, documents, etc.

[edit] This Wiki

[edit] How do I edit things?

First Get Access, then click on edit either at the top bar or on the side. If you click the side one, you will only see the associated section or subsection. This is convenient on long pages (like this one).

[edit] How do I format things?

See https://www.mediawiki.org/wiki/Help:Formatting. For some more specific examples:

[edit] How do I put figures into the text?

Sample right-justified thumbnail image.
Sample right-justified thumbnail image.

First go to Special:Upload to upload the figure file. Then use a one of the markups listed at https://www.mediawiki.org/wiki/Help:Images. I recommend using the right-justified thumbnail format:

[[Image:vxi-crate.jpg|thumb|right|VXI Crate full of TIG-10s]]

This will give you a picture like the one at the right.

If you forgot where you put your figure files (or want to re-use another one), look in Special:Imagelist.

[edit] How do I make tables?

Tables are a completely different kettle of worms. See https://www.mediawiki.org/wiki/Help:Tables.

If you want to make a sortable table, that is, one where you can click on the table header to order the table by a particular column, ascending or descending: see https://www.mediawiki.org/wiki/Help:Sorting#Sorting_rows_of_a_table.

[edit] Where did some of this missing stuff go?

  • Old-Pourri for old stuff. In particular, I don't think anyone uses Cygwin anymore so all that stuff has been moved.
  • Safety-GH for safety related references.

[edit] Isn't there a more condensed way to show "Recent Changes"?

Yes, and you have to select it yourself in.

  • Log into the Wiki
  • Select My Preferences from the very top
  • Select the Recent Changes tab
  • Check the Enhanced Recent Changes checkbox.

Note that this doesn't work on all browsers, so it is not enabled by default.

[edit] Mac OSx

[edit] Why does my laptop tell me "There is no connected camera" when I have a camera on it?

Not sure, but the solution is:

sudo killall VDCAssistant

[edit] Unix-y things

[edit] Where are my X-windows and how do I find them?

It is, unfortunately, a fairly well-known bug that the new version of XQuartz versions around 2.7.7 (Yosemite) don't handle multiple displays very well and as a result can put X windows in places where you can't reach them, e.g. with control buttons or worse yet the whole bloody window far off screen where you have no hope of accessing them. One solution is to use xdotool from MacPorts to adjust window sizes & positions.

For example, when I log into the LN2 fill systems from my Mac w/ an external screen in my office, the useful control window tiggenln2.edl is not visible, but it does appear on the list of X windows. The window can't be resized, moved, minimized, maximized or anything. To solve this, after logging in to the appropriate Epics machine, go to a local terminal window and issue commands like:

hackman@hackbook-usb:~> xdotool search edl
Warning: XTEST extension unavailable on '(null)'. Some functionality may be disabled; See 'man xdotool' for more info.
Defaulting to search window name, class, and classname
14680234
hackman@hackbook-usb:~> xdotool getwindowgeometry 14680234
Window 14680234
  Position: 347,153 (screen: 0)
  Geometry: 960x720
hackman@hackbook-usb:~> xdotool windowmove 14680234 1000 2400
hackman@hackbook-usb:~> xdotool windowsize 14680234 500 500
hackman@hackbook-usb:~> xdotool getwindowgeometry 14680234
Window 14680234
  Position: 1000,2444 (screen: 0)
  Geometry: 500x500
hackman@hackbook-usb:~>       

There appears to be better ways to do this such as integrating the search command as part of a chain of commands or using a script. However I found it took a lot of trial and error to find sizes & positions that would work. A geometry that worked for the gf3 Graphics Window fails miserably for the EPICS tiggenln2.edl, as an example. (Furthermore the epics windows only appear on the laptop screen when you do this; if you move it to a legitmate position on your secondary window, it still won't display.) So it becomes an infinite monkeys problem pretty quick. Make the window as small as you dare and then try moving the window around in increments of about 500 in both directions until you see something somewhere.

The XTEST warning actually appears on each command if you don't have XTEST set up properly. I haven't figured out how to do that yet.

As a little side note, xdotools uses the MacPorts gettext package. When gettext installs, it requires a java runtime environment. This install is very finicky; I only got it to work after deleting and re-installing Xcode from scratch, installing a new JDK from Oracle, and cleaning Macports sudo port clean all before it would work. If you get "can't find mfgtst.c" or some similar error, do all three of these things (Xcode, JDK, clean all) and try again. It's frustrating.

[edit] My process are hung up, can I un-hang them?

kill -CONT procnum '

I had a situation where my processes were hanging up one by one. In the End Task window they were listed as Paused rather than as Not Responding. The above command will tell them to resume, even though they will still appear as Paused in the End Task window. Save your work immediately and then close your window. After you've done this to all your applications, reboot, because if you don't, it's gonna happen again.

[edit] Linux

[edit] How do I use Linux?

Linux is the operating system of choice for most of the data acquisition and analysis workstations at TRIUMF. People who (think they) are serious computer scientists also use Linux for day-to-day computing tasks. One way or another, it's good to learn how to use it.

[edit] Beginners

[edit] More advanced users

[edit] Useful sysadmin commands

  • chkconfig -- check and reconfigure when services are started
  • /root/iptables.info -- TCPIP access stuff

[edit] Why doesn't mysql work?

[edit] Getting started

I was trying to get mysql running on one of our cluster computers so that I could use gallery. First I had to start it: as root, service start myslqd. Then when I tried to follow the gallery instructions for setting up a database, I kept getting access denied errors. The "usual" passwords for root didn't work. This page here was pretty helpful. After killing the currently running mysqld service and processes:

[root@dixie init.d]# /usr/bin/safe_mysqld --user=root --pid-file=/usr/local/mysql/data/mysqld.pid --skip-grant-tables &
[1] 15503
[root@dixie init.d]# Starting mysqld daemon with databases from /var/lib/mysql
[root@dixie init.d]# mysql -u root mysql
Reading table information for completion of table and column names
mysql> update user set password=password('newpass') where
 -> User='root' and Host='localhost';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@dixie init.d]# kill %1
[root@dixie init.d]# 070528 11:43:08  mysqld ended
[1]+  Done                    /usr/bin/safe_mysqld --user=root --pid-file=/usr/local/mysql/data/mysqld.pid --skip-grant-tables
[root@dixie init.d]# /sbin/service mysqld start
Starting MySQL:                                            [  OK  ]
[root@dixie gallery2]# mysqladmin -u root -p password th21x5G
Enter password: newpass
[root@dixie gallery2]# mysqladmin -u root -p status
Enter password: th21x5G
Uptime: 225  Threads: 1  Questions: 6  Slow queries: 0  Opens: 7  Flush tables: 1  Open tables: 1  Queries per second avg: 0.027
[root@dixie gallery2]# 

That worked fine. Some of the output and carriage returns have been omitted for brevity; also the passwords (in italics) don't actually show up. Obviously, using "newpass" as my new password initially was just dumb. (And no, that isn't the real root password.)

[edit] Gallery (or some other package using mysql) froze up due to errors

I couldn't access our photo gallery and all I got was an Error (ERROR_STORAGE_FAILURE) message with some references to lines in code. To debug this I had to edit the config.php in the gallery directory so that the debug setting was $gallery->setProfile('buffered'). Once I did that I got a debug message that warned that the demon had been suspended (or something) due to too many access attempts followed by instructions. The instructions also advised to execute mysqladmin -u root -p flush-hosts. I suspect this is a good first thing to do whenever a mysql-based application locks you out.

[edit] How do I set /dev/ttyS0 to mode 666 permanently?

To change the ownership and mode of a device on startup, first find the file (or a file like) /etc/udev/rules.d/50-udev.rules. Find a line that looks like:

 KERNEL=="tty[A-Z]*",            NAME="%k", GROUP="uucp", MODE="0660"

Change the MODE argument from 0660 to 0666. In all subsequent boots, /dev/ttyS0 etc. will be user read- and write-able. See also here.

By default, SL5 sets /dev/ttyS0 (in fact, all /dev/tty[A-Z]*) as belonging to user root, group uucp, mode 660. This is set on bootup. If you try to read it as a normal user (e.g. from a MIDAS front end program), you will not be able to access the device. You will (should?) get a Permission Denied error. To solve this, the easy short-term solution is to chmod 666. However, this change will normally be lost on reboot. The above instructions set the default boot-up configuration.

\m/

[edit] My cron jobs fail! Almost as if a bunch of environment variables aren't set! (like paths)

This happened to me on the SOH machine. The most annoying symptom is that things which seem to work perfectly fine in interactive shells would fail miserably as cron jobs.

The most straightforward way I could see to do this was to run your process as a new command within a new login shell:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/sh -l -c /home1/tigsoh/PythonScripts/SOHProcCheck.py

This way the command (in this case, SOHProcCheck.py) runs exactly as from a regular, logged-in, interactive shell. Also, it is strongly recommended to use the crontab -e form rather than piping files into a bare crontab command. The -e option brings up vi, and (apparently) checks the format (strips out extra characters for e.g.) to makes sure it works. Finally, if you want to avoid getting a zillion e-mails about your cron jobs, put the line MAILTO="" at the top of the crontab.

[edit] The toolbar disappeared! So did all my minimized windows!

I only know how to deal with this in KDE.

If this happens, you can still bring up a menu by clicking (right or left? I don't know) and starting a new Konsole. At that point type in kicker . This will give a bunch of error messages, but hopefully will bring the toolbar back, along with all your minimzed and lost windows.

An alternative command is dcop kicker kicker restart which seems to be the more correct way to do it.

[edit] I can't move my windows!

[edit] Gnome

This worked on the megalodon computer upstairs in the counting room. All the windows were frozen and unresponsive. I couldn't even change focus.

Press Alt-F2. Then in the "Enter a Command" window, just type r.

Solution found on Debian bug reports but seems to work on SL/Centos too.

[edit] KDE

In a konsole, do

nohup kwin --replace &

I honestly don't know what this does, other than, it fixes the problem. Plus I think it might only work if you aren't completely frozen.

[edit] How do I use the screen command?

See Screen Command.

The screen command allows you to run commands and "detach" them, then "reattach" them later. This has a LOT of potential use in our DAQ system.

Some info can be found at:

Some hints on usage that I've found ... um ... useful:

  • screen -h 10000 will launch a screen with a 10000-deep scroll buffer. If you use the -h flag, then you can use copy mode as a de facto means of scrolling up.
    • You can also add and with -S fetigcoll to append this text to the session name rather than the tty number. In principle the tty number could be handy for figuring out which screen session a given process is running in, but I've never had any luck with it.
  • ^a d detaches the screen; anything running in the screen continues to run, and standard output continues to go somewhere.
  • screen -x" allows you to attach to a screen session without detaching it from somewhere else.
    • This lets you look at the same screen session from multiple locations e.g. in the shack AND in the counting room. It is superior to screen -r or any of the other versions of "reattach", all of which either require you to detach, or worse, force a detach on you.
  • ^a [ puts you in copy mode. From here you can use the arrow keys to move up a line a time, or ^b and ^f to move up and down a page at a time. Any command that is illegal in copy mode will take you out of copy mode; <ESC> works just fine.
  • screen -ls shows you all the screen sessions running at the moment and if they are attached or detached. Unfortunately it doesn't tell you what's running in it.
  • This little csh script will find all of the screen sessions on this machine associated with the current user and list all the processes running under that screen session. This is a great way to figure out if a given client is running in a screen session, and if so, which screen session to connect to. It is handier than screen -ls. It also exists as ~tigress/screenls.
#!/bin/tcsh -f
foreach pid  ( `ls /var/run/screen/S-$user | sed 's/\..*$//' `)
pstree -a -A -p $pid
end

[edit] rync - safe data copying

A safe way of copying large quantities of data is to use the rsync command, for example:

rsync -ravptn source_directory /target_directory/

Note that including the '/' after the target directory will copy the entire source directory into the target.

Here:

  • -r = recursive
  • -a = archive
  • -v = verbos
  • -p = maintains original permissions
  • -t = maintains original time structure
  • -n = dry run

-n is particularly useful, it does a dry run of the sync, which helps to make sure everything works. After you've done this, simply remove the -n option, and sync your data with confidence(?)


[edit] Windows

[edit] How do I view EPICS control pages in Windows?

See this page by ISAC Controls.

[edit] I lost my Add Network Place wizard!

No problem. Just run:

RunDll32.exe netplwiz.dll,AddNetPlaceRunDll

[edit] How do I copy all my files?

When I've wanted (or had) to make a complete backup of the files on my hard disk:

ROBOCOPY c:\ e:\back2\  /TEE /S /E /COPY:DATS /PURGE /MIR /B /R:0 /W:0 /LOG:e:\back2a.log

This copies everything off your C drive into a directory on E, and it generates a log file that includes all the information on the files and any errors that came up.

By default, Microsoft seems to give you the option of backing up and restoring either a bare minimum of your documents (the My Documents and Desktop), or everything on the disk. The first option will *not* restore your Thunderbird inbox or GPG keys, for example. The second option risks re-installing troublesome files or settings. This option gives you the option of re-installing things one-by-one as needed, without losing anything -- handy if you are upgrading to a new system (hardware or OS).

ROBOCOPY is the Microsoft Robust Copy program. It's the "next in line" to XCOPY. It comes as part of the Resource Kit Tools package for Windows 2003, and is usually packaged as rktools.exe. I had to download and install it.

The command line options allow a lot of flexibility and power. The /MIR option is most valuable (in my mind) because it provides an excellent means of performing incremental backups. Note that the /COPY option defines what security options to copy over. This can be a problem if you try to read the files on a different machine that doesn't have identical NTFS security databases (for example, I can't read "My Documents" on a general-access machine).

[edit] How do I do a screen capture?

The Print Screen key can work, but it's not very flexible or for that matter useful. I recommend something else:

  1. Download and install AutoHotKey.
  2. Download and copy the script Capture.ahk. In most browsers, right-click on the link and Save as.... Save it to somewhere convenient, like your Desktop.
  3. Double-click on it. If everything worked well, a little white H in a green box will appear in your system tray.

Now, you can use the funny Windows-logo key (which I will call the Win key) as part of a keystroke combination to capture and save a window, the client part of a window (no borders), or the whole screen. It will either be captured to the clipboard so you can paste it, or it will be saved immediately as a .png file.

The keystroke for saving to a file are:

  • Win-s: save the entire Screen
  • Win-w: save the current selected Window
  • Win-c: save the Client of the current window

The files will be saved to the Desktop with a name like screen##.png, window##.png, or client##.png. The ## is a number. The number will be automatically incremented from the largest one currently on the desktop. You won't overwrite any screen captures by accident. (You do need to clean up your desktop once in a while, though.)

If you want to simply copy the screen so you can paste it into something else of your choice, use Shift-Win-S, Shift-Win-W, and Shift-Win-C respectively.

You will have to "run" Capture.ahk before you use it. I would suggest putting it in your C:\Documents and Settings\you\Start Menu\Programs\Startup folder, if you like it.

Credits: I didn't write this script. Capture.ahk is just a script described in the AutoHotKey forums. All I did was put in the key-stroke definitions.

[edit] I can't access a remote server, it says I don't have permission!

I've had problems accessing \\trwindata\groups\drawing. It seems that I am connected with improper credentials. Unfortunately Explorer doesn't (seem to) allow you to log out and log back in easily. The best way to do this has been through the command console:

C:\> net use * /delete
You have these remote connections:
                    \\trwindata\groups
Continuing will cancel the connections.
Do you want to continue this operation? (Y/n) [N]: y 

C:\> net use /user:hackman@TRWIN \\trwindata\groups
The password or user name is invalid for \\trwindata\groups.
Enter the passwword for 'hackman@TRWIN' to connect to 'trwindata': password
The command completed successfully.
C:>

[edit] I forgot my Administrator password!

A quick Google search will reveal a whole bunch of options for doing this. If you are fairly comfortable with Linux command-line tools, I recommend going to http://pogostick.net/~pnh/ntpasswd/. There, you will find an .iso image that you can burn to a CD, then boot that CD into a minimal shell with access to the Windows security files, including the password files. From there you can, in principle, change the Administrator password, or any user password for that matter.

The utility and the instructions were straightforward enough for me to use, and I have used it successfully to set Administrator passwords to null (i.e., no password). I have had mixed (undocumented -- sorry) success setting new passwords, but in many cases, simply resetting the Administrator password to null is an adequate starting point for anything else you think you need to do.

This utility is text-based -- if you want a fancy GUI you'll have to pay for it.

[edit] Root

[edit] How do I get the nice colourful palette instead of the yucky brown one?

gStyle->SetPalette(1)

[edit] Networking / Remote Access / Security

[edit] How do I get to a TRIUMF machine?

This is a tough question with a lot of different answers depending on what you are trying to do.

The most broadly applicable solution is to start up a remote desktop on trcomp01.triumf.ca using NX Client. That allows you to further access all TRIUMF computing resources as if you were personally sitting in front of a keyboard, mouse and display attached directly to trcomp01. It's probably the easiest and most secure solution and is the most user-friendly. To do this you have to:

  • have a working knowledge of (or the patience to learn) a Linux-style GUI
  • have access to an add-new-software level account on your machine (Administrator or Power-User on Windows, root on Linux)
  • have an account on trcomp01. You may request an account. You can get further help on accounts from TRIUMF Core Computing and Networking.
  • download and install the NX Client. For Windows you can get this from here.
  • download and install the NX fonts available at the same site. This is optional but strongly recommended. Certain TRIUMF resources (like EPICS) only worked after I installed the 75dpi and 100dpi fonts.
  • configure NX. Open the NX Client from your Start->Programs, and then enter these settings (cut-and-paste from an E-mail from Kel Raywood:
    • Session: trcomp01
    • Host: trcomp01.triumf.ca
    • Type of Internet Connection: LAN (or WAN for high-bandwidth connections or ADSL from home)
    • Desktop: UNIX - GNOME
    • Size of Remote Desktop: Full Screen (or something else if you want)
    • Do NOT check "disable encryption on all traffic".
    • When the "Show the advanced configuration" dialog check-box comes up, check it.
    • In the Server tab, click on the Key button
    • Replace the default DSA key with something Kel gives you (contact him for the key).
    • Save the key, save your connection settings and enter login-name and password.
    • The first time that you connect you will be informed that the host key is unknown. This is different than the connection key. The host-key identifies the remote-host to you and the connnection key does the reverse.
    • To minimise (hide) the remote session, hit Ctrl-Alt-m.
    • To suspend or disconnect your session, hit Ctrl-Alt-t.

Once you are it this stage, you can start up a web browser on the remote desktop and view local-access-only web pages, or SSH into local-access-only machines like the EPICS display servers.

[edit] How do I ssh to isacepics1.triumf.ca directly from home???

The following works if you have a Linux machine or have installed and are running Cygwin/X.

In one terminal window, log in with the following:

ssh -L 2112:isacepics1.triumf.ca:22 user@trcomp02.triumf.ca

Then in another terminal window:

ssh -Y -p 2112 otheruser@localhost

The first part sets up port forwarding, in general. This can also be used for MIDAS pages. For example, in a terminal window:

ssh -L 8081:isdaq08.triumf.ca:8081 user@trcomp02.triumf.ca

Then in your broswer, type in the address bar

http://localhost:8081

[edit] I can't access Linux box xxxx by ssh, or http, or mhttp, or ...

If it's a machine here at triumf, chances are it uses iptables as a firewall. There is a sufficiently detailed but still readable guide available online.. The file that configures the firewall is /etc/sysconfig/iptables, and the commands you will most likely need to use are iptables-save > file, iptables-restore < file, and /sbin/service iptables restart.


[edit] How do I transfer massive files quickly? scp is too damn slow.

From midtig01 to syrinx (my laptop):

First set up syrinx to receive: ttcp -r | tar xvBf - . Then set up midtig01 to transmit: tar xvBf - run20001.mid | ttcp -t syrinx

[edit] Office

[edit] Mac OSX: Some of my toolbar options are missing. How do I restore them?

See here. Go to ~/Library/Preferences and delete com.microsoft.Excel.plist. If this doesn't work, the linked page might give you the hints you need to figure it out.

[edit] How do I strip non-numeric numbers from a mixed string and leave behind a number?

I found this formula at www.mrexcel.com:

 =SUMPRODUCT(MID(0&A263,LARGE(INDEX(ISNUMBER(--MID(A263,ROW($1:$25),1))*ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10)

This worked for Row 263. Replace the instances of 263 as needed. I don't know how it works.

[edit] The reference styles in Word are awful. How do I get something more scientific looking?

You want Bibword Styles, which you can download from bibword.codeplex.com. Basically you just download the .zip file, unzip it, and them move all the .XSL files to the right place. Instructions for installation are given there too. No particular gotchas, although finding the correct subdirectory with all the .XSL files is a bit of a challenge. On my PC they were in C:\Program Files\Microsoft Office\Office12\Bibliography\Style\; on my Mac with Office 2011, they were in /Applications/Microsoft Office 2011/Microsoft Word.app/Contents/Resources/Style/. I personally am a fan of IEEE_Reference, since it gives you square-bracket numerical references.

[edit] I can't edit some of my PowerPoint presentations any more.

The most common symptom along these lines is that when you open the .ppt you get a popup window something like "This presentation cannot be edited because it contains a read-only embedded font." If this is the problem, then chances are the presentation is using a font that you don't currently have installed on your system.

If it's a presentation someone else sent you, ask them to turn off font embedding, then prepare to clean up screwed-up typesetting.

If it's a presentation of your own, you will have to install the missing fonts. You can find out which fonts a presentation uses through Properties -> Contents. Check that these fonts actually exist in the Fonts system folder.

I've had problems with Arial Unicode MS and Arial Black Italic. The first one was easy. The second one was trickier, and took much digging around. In my presentation Arial Black was embedded, but Arial Black Italic was not. For reasons beyond my comprehension, you need both. Apparently this is a bug Microsoft hasn't gotten around to fixing yet. In both cases I restored the missing font file (or files) from a backup set, and then re-installed the font(s). If you have the second problem I would suggest deleting Arial Black and reinstalling both Arial Black and Arial Black Italic.

There are some very good descriptions on this problem here and here.

[edit] How do I export data from a multi-sheet .xls file into .csv format? I have a big workbook with lots of sheets.

Here's something that you can use as a macro to generate one .csv file for each sheet in an .xls file.

Option Explicit
Sub testme()
Dim wks As Worksheet
Dim newWks As Worksheet
Dim MyPath As String
Mypath = ActiveWorkbook.Path
For Each wks In ActiveWorkbook.Worksheets
  wks.Copy
  With ActiveSheet
    .Parent.SaveAs Filename:=MyPath & "\" & .Name, FileFormat:=xlCSV
    .Parent.Close savechanges:=False
  End With
Next wks
End Sub

I found this little stub of code in a Google search but didn't keep track of the original link (sorry).

[edit] Mozilla

[edit] How do I turn off the annoying "Restore Session" dialog in Firefox?

Follow this hint:

  • Type in the url bar: about:config and press the Enter key. That opens a page with preferences.
  • Try to find the browser.sessionstore.enabled pref. It may not exist. If it does not exist:
    • Right click on the page to open the context menu and choose: New → Boolean.
      • Name: browser.sessionstore.enabled
      • Value: false
  • If browser.sessionstore.enabled does already exist, right click on it, and select Toggle.

[edit] Thunderbird won't update. What's wrong?

Try unplugging your webcam.

My wife's Thunderbird would try to update, and would get in an endless loop where it would start updating, then pop up a dialog box saying something to the effect of Error updating software . It would then suggest that you close all your applications, check your permissions for an obscure .dll file, and retry. Of course this didn't help and we ended up in an infinite loop.

It turned out that our Logitech webcam software was the cuprit. It was loading a Thunderbird .dll and never letting it go. Of course you can't update a file that some other program is using -- even if it's a background service that you can't find running anywhere.

A detailed description can be found on the Logitech forum. The easiest solution is to unplug your webcam when you're not using it. And certainly unplug it when Thunderbird tries (and fails) to update.

I've read that simply turning off the webcam isn't enough, you have to unplug it. Unplugging it worked for me. Some other brands use the Logitech drivers so this solution may work for Thunderbird problems.

[edit] Programming

[edit] I've never used C before!

One of the TIGRESS summer students, Adrian Fonseca, found and liked C Programming in easy steps [FIXME] by Mike McGrath. The ISBN is 1-84078-203-X.

[edit] ... or Python ...

I started out with this PDF file here. If the link is no longer active, just do a Google search for PythonIntro.pdf.

[edit] My compiler tells me I have trouble but only gives me funny characters, it doesn't tell me where!

It's been my experience that GCC puts symbol information in single quotes:

 [tigsoh@tigsoh01 CAENHVWrapper]$ make
 gcc -DUNIX -Wall -I. -o transport -c transport.c
 transport.c: In function 'sendReceive':
 transport.c:398: warning: unused variable 'i'

More recent versions use directional, slanted quotes. If it uses the normal ASCII characters, you'll be OK.

 transport.c: In function ‘sendReceive’:
 transport.c:398: warning: unused variable ‘i’

Depending on the version of GCC and the terminal application you are using, this information can get garbled or lost altogether:

 transport.c: In function â:
 transport.c:398: warning: unused variable â

This problem occurs because GCC uses UTF-8 encoding[1] and not every terminal automatically expects that. Xterm on Cygwin seems especially unable to handle UTF-8. On solution is, once you've ssh'd to the SL5.2 machine you are compiling on, start a new xterm with xterm -u8

[edit] PDF

[edit] I don't wanna pay for a full version of Acrobat!

I've found a few things that you can use to do many (not all, but many) of the things Acrobat does. Not all of them come with nice GUIs. If that's your bag, don't be so cheap.

  • CutePDF lets you create PDFs by printing from an application. Not as functional as Adobe's PDF printer driver, but usable.
  • pdftk is a command-line utility for doing a lot of different page manipulations like extracting, catenating, etc. I haven't tried the other utilities on that page. pdftk comes with Cygwin.
  • Inkscape can read PDF files. I haven't tried it as a multi-page document editor but I have used it to extract simple images from single-page .pdf files.

[edit] How do I print the filename and page of a PDF automatically in the footer?

I can't help with that directly, but I did find an Adobe forum thread that pointed to a JavaScript addin that helps. Download it and put it in the Javascripts directory in your Acrobat installation (mine was C:\Program Files\Adobe\Acrobate 8.0\Acrobat\Javascripts). Next time you start Acrobat, you get a main-menu pulldown option to add the date & filename, and the page number, to the footer of the file. You can then print it after that. It's not perfect, and it's neither completely automatic ... but it's the best of the free options I've found so far. Note: This does require a full version of Adobe Acrobat, so it's not entirely free.

[edit] How do I put two copies of the same page together?

Say you scanned a book (totally legally not violating any copyrights of course), both pages on a single image, all nicely in order -- and you want to crop it so that each of the two pages on the scan shows up as separate pages. You can do this by duplicating all the pages and then cropping them correctly. The question is how to efficiently and automatically do the first step.

First off you need to get pdftk described above. The command of interest is

pdftk A=scan.pdf B=scan.pdf shuffle A B output icky.pdf

[edit] Mechanical Design

[edit] What are these things we call Marmon Flanges at TRIUMF?

Based on my own poking around through various sources, the things we call Marmon Flanges that we use here at TRIUMF are a hybrid between "real" O-ring-sealed Marmon flanges (see page 29) and "LF ISO Modified" flanges. The earliest drawings I could find of these devices are labelled B-3130 for a flange to be welded to 4" beam pipe, and B-3131 for the centering ring. Both of these drawings are in the Design Office PDMWorks vault as scanned electronic copies. The centering ring is narrower in the beam-axis direction and uses a smaller cross-section O-ring than LF-100 ISO, so it's not perfectly compatible.

[edit] Thread sizes?

[mdmetric.com Maryland Metrics] has a lot of documentation for threads. A nice summary table for machine screws is here. But in general their technical data page index has everything you could think you'd need to now.

[edit] Quartus firmware notes

quartus_pgm -c 2 --mode=jtag -o p\;TIGC_Master.QUARTUS9.STB31.12Feb2015.PT1andT1.sof@1 -o pv\;TIGC_Master.QUARTUS9.STB31.12Feb2015.PT1andT1.pof@2; 

[edit] SVN

[edit] A couple useful commands

(This also helps you find firmware.)

dmiller@horus:~/svn/firmware >svn log file:///home/svn/FirmwareRepo/TIG10
Personal tools