Ufff.... that what happened to me just some minutes ago: after a restart of my MacBook white, due to an overload (the system started to respond very slow, I had too many apps opened and it was many days I didn't shut it down)..... I had no more soud!!!
Remembering the old days, when I was used to spend hours in fixing Windows problems with drivers, corrupted updates and so on..... I was already prepared to do it...
But actually it was very easy fix!! And it was not due to Mac Os X itself, but to Soundflower application which I have installed on my system!!
Eh eh!! Mac...the more I discover you, the more and more I love you!! :-P
Problem:
No more audio after a restart of Mac Os X 10.6 Snow Leopard (mine is 10.6.4 version)
Solution:
If you have Soundflower installed, that may be the cause.
Soundflower is a software to redirect the output sound from the system or from an application to another application, where it's used as input source. It's a very nice piece of software indeed!
Usually I keep it off, but for some unknown (to me) reasons, after that restart the sound output
was not set anymore to the "Internal Speakers" (as the normal default), but to "Soundflower 2Ch". Changing back to "Internal Speakers" fixed the problem!! :-)
To check and fix it:
Go to "System Preferences" (from the Dock, or from the Apple Icon menu on the top bar), then go to "Sound", then go to the "output" tab; there you can see the option "Select a device for sound output" where, if you have Soundflower installed,you can select between:
Internal Speakers
Soundflower (2ch)
Soundflower (16ch)
In my case, after the restart, the output was strangely set to "Soundflower (2ch)", and setting back to"insternal Speakers" fixed the problem.
Have a nice summer day! :-)
Saturday, August 7, 2010
no more sound after a mac os x restart? Fixed
Pubblicato da
Pelerin-Voyageur
a
12:48 AM
0
commenti
Etichette: mac Os X, sound, system administration
Tuesday, May 4, 2010
Using Kerberos on Mac Os X 10.6 Snow Leopard
Problem:
I tried to use Kerberos authentication system out-of-the-box with my new Mac, and when I try to get a ticket I got this error:
$> kinit user@HOST.COM
$> kinit: Unable to acquire credentials for 'user@HOST.COM': Cannot resolve network address for KDC in realm HOST.COM
Solution:
So I googled a bit and I tried some recipes, but I just discovered that the order with configuration files are read by Kerberos changes sometimes. So instead of the conf file inside~/Library/Preferences/edu.mit.Kerberos
I had to copy the same file to/etc/krb5.conf
So create those two files with a content like this:
[realms]
HOST.COM = {
default_domain = host.com
kpasswd_server = afskrb5m.host.com
admin_server = afskrb5m.host.com
kdc = afsdb1.host.com
kdc = afsdb2.host.com
kdc = afsdb3.host.com
}
[domain_realm]
.host.com = HOST.COM
And you are done!
Then you can try using kinit to get a ticket like:
$> kinit user@HOST.COM Please enter the password for user@HOST.COM:
$> klist
Kerberos 5 ticket cache: 'API:Initial default ccache'
Default principal: user@HOST.COM
Valid Starting Expires Service Principal
05/04/10 15:28:11 05/05/10 01:28:11 krbtgt/HOST.COM@HOST.COM
$>
Note!
If you are looking information on how to access the CERN AFS from Mac Os X, you can find the settings for CERN here:
http://linux.web.cern.ch/linux/docs/kerberos-access.shtml
You can also look at this nice twiki about AFS at CERN with Mac Os X. But remember to edit the right config file in the right folder, otherwise Kerberos will complain.
https://e5wiki.physik.tu-dortmund.de/bin/view/Main/MacOSXCernKerberos
Pubblicato da
Pelerin-Voyageur
a
6:30 AM
1 commenti
Etichette: AFS, CERN, Kerberos, linux, mac Os X, system administration
Monday, May 3, 2010
How to change or clear your Subversion password used by eclipse plugins on Mac OS X
I assume that you are using Eclipse Galileo on Mac Os X Snow Leopard, with JavaHL SVN client.
It happened to me that once I updated the password of my account on the subversion server machine, Eclipse did not allow me to connect to the repository anymore; moreover it did not ask me for a new password, I merely got errors like "The folder does not exists on remote server" and authentication errors on the Eclipse SVN Console.
After googleing for a while, I did not find the solution yet, and so I started to play around. Finally I solved the problem and I post the solution here; I hope it can save you some time :-)
You have to open the "Keychain" application from "Applications" --> "Utilities" --> "Keychain"
There you will find an "application password" related to SVN: mine contains something like "https://svn.host.com/". You double click on it and you change your stored password with the new one.
Now if you close Eclipse and then you open it again, it will notice that the SVN password was changed and when you will try to access the repository again, Eclipse will ask you the username/password couple again. You can type the new password again, and you can "save" it if you want. The new password is set.
Hope that helped! :-)
Pubblicato da
Pelerin-Voyageur
a
12:35 PM
0
commenti
Etichette: eclipse, mac Os X, Subversion, svn, system administration
LaTeX: how to include a minted pygmentized piece of code in a figure environment, with three minipage in a row
Sometime we want to put two, three or more LaTeX objects side by side on one row. For example we want to put more figures one next to the other. Or we want to build complex figures gathering under one "figure" environment more objects like formatted text, images and highlighted source code using pygmentize and minted. Here below you will find a working example.
The same example is valid if we want to put fancy texts side by side like inside boxes, because the \fbox
command does not allow to use complex-formatted text inside.
Here what you get
and here below the code to generate it.
ATTENTION!!!! Pay attenion to not insert empty lines in the source code between minipages!! Otherwise you will get the minipage environment put in a vertical column: because the empty lines will be evaluated as "new line" breaks. I say it here because I waisted some hours looking for this "bug"!!! ;-D :-P
\begin{figure}[h]
\centering
\begin{tabular}{c}
\begin{minipage}[c]{.40\linewidth}
\centering
\epsfig{file=ImagePlaceholder, scale = 2.0}
\end{minipage}
\begin{minipage}[c]{.10\linewidth}
\centering
\epsfig{file=RightArrow_Grey, scale=0.6}
\end{minipage}
\begin{minipage}[c]{.45\linewidth}
\begin{minted}[bgcolor=bg, fontsize=\tiny ]{python}
'3j0lep':{
'selectionCuts': {
'electron':{'deltaR_ej': 0.25}
}
'cuts': { 1: { 'label': 'Cut1',
'value': [20*Units.GeV]},
2: { 'label': 'Cut2',
'value': [100*Units.GeV,
40*Units.GeV,
40*Units.GeV],
},
3: { 'label': 'Cut3',
'value': 80*Units.GeV, },
},
}
\end{minted}
\end{minipage} \\
\\ %empty line for some space
\footnotesize
From requirements...
\hfill
...to the code!\\
\end{tabular}
\caption{Main caption.}
\label{MainILabel}
\end{figure}
Pubblicato da
Pelerin-Voyageur
a
8:16 AM
0
commenti
Etichette: LaTeX
Thursday, April 2, 2009
Linux: How to use an external hard disk, how to mount it
Problem: In my case I plugged the external hard disk into the USB port; a new folder with the name of my external HD was created, but it was empty.
Solution: I had to mount by hand the external hard disk, even if it was automaticaly recognized and a folder for it (empty) was created.
----------
The problem was that, when I plugged my external HD to the USB port of my Linux box, the disk was recognized and a folder was created under /media/NewHD
, but the folder was empty. NewHD
is the label, the name, that I choose when I first formatted my new USB external disk.
To solve I followed these steps:
- You have to find the "dev" name of your external HD after you plugged it in:
dmseg
You will find something like these lines:
Initializing USB Mass Storage driver...
scsi6 : SCSI emulation for USB Mass Storage devices
Vendor: SAMSUNG Model: HM251JI Rev:
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sdc: 488397168 512-byte hdwr sectors (250059 MB)
sdc: assuming drive cache: write through
SCSI device sdc: 488397168 512-byte hdwr sectors (250059 MB)
sdc: assuming drive cache: write through
sdc: sdc1
From the last line you know that your external drive was mapped by Linux to the/dev/sdc1
- You have to check if the external drive was actually mounted somewhere else:
mount
You get something like this:
[root@hece02] /media $ mount
/dev/mapper/VolGroup00-LogVol00_Root on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
/dev/mapper/VolGroup00-LogVol01_Home on /home type ext3 (rw)
/dev/mapper/VolGroup00-LogVol02_Scratch on /localscratch type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
AFS on /afs type afs (rw)
If your/dev/sdc1
is present there, you know that you can access the content of your drive from the path associated with the/dev/sdc1
. Otherwise keep following. - You have to mount the external hard disk:
mount /dev/sdc1 /media/NewHD
- And now you can access the content of your disk! :-)
Just type:
umount /media/NewHD
then you can unplug it.
Pubblicato da
Pelerin-Voyageur
a
7:33 AM
0
commenti
Etichette: linux, system administration
Python: Exception TypeError "argument of type 'instance' is not iterable" in 'garbage collection' ignored. Fatal Python error: unexpected exception
Problem: I got a nasty Fatal error message running my Python code: "Exception exceptions.TypeError: "argument of type 'instance' is not iterable" in 'garbage collection' ignored"
Solution: I forgot to use vars() function when checking the existance of a variable in an imported module
-----------------
I got this error in my Python code today, and it took me 20 minutes to understand where the bug was.
Actually the line number showed in the error message was false. The error itself started some lines above and it propagated until the incriminated line.
So this was the error:
Exception exceptions.TypeError: "argument of type 'instance' is not iterable" in 'garbage collection' ignored
Fatal Python error: unexpected exception during garbage collection
Aborted
And the problem was an "IF" statement where I checked for a variable name in an imported module:
My "IF" was this:
if 'fileName' in myModule:
fileName = 'OutputFile_%s.py' % myModule.fileName
To fix the problem I had to correctly add "vars()", of course ;-)
if 'fileName' in vars(myModule):
fileName = 'OutputFile_%s.py' % myModule.fileName
The bug was very stupid, just forgot the "vars()" function. But it was not so easy to find because the error message Python gave was not so helpful.
Pubblicato da
Pelerin-Voyageur
a
5:09 AM
0
commenti
Etichette: programming, python
Wednesday, April 1, 2009
Eclipse IDE: How to install and configure MinGW GNU C++ compiler for Windows
Eclipse IDE has the very nice CDT environment for C++ programming.
In order to use it under Windows, you have to install a C++ compiler.
Our suggestion is to install the MinGW compiler, "A MINimalistic Gnu for Windows" Gcc compiler.
Go to http://www.mingw.org/ and download the installer for Windows from here.
Then start the Installer and choose to install the basic package + the g77 compiler + Make for MinGW, as those are the tools needed for compiling C++ code with Eclipse... and not only with Eclipse ;-)
Once installed everything you have to add the MinGW path to your PATH environment variable, to make the compiler findable.
Let's say we have installed the MinGW package on C:\MinGW. Refer to the picture below.
You have to open Start --> Control Panel --> System. In the pop up window that appears select on the left side "Advanced System Settings" and then goes to the tab Advanced and choose "Environment Variables...". There look for the "Path" variable in the System Variables window below (look for PATH, instead, if you want to set the MinGW compiler only for you as user) and click on "Edit...". In the pop up window you'll find a long string to edit. Go to the end of that string line and add ";C:\MinGW\bin". Then "Ok" and again "Ok".
Now your new nice MinGW compiler is ready to be used.
To make a test open a new command prompt (Start --> All Programs --> Accessories --> Command Prompt) and try to type "mingw32-make --version". If everything worked fine you should see a window telling you the version of the newly installed package.
Now open your Eclipse IDE with CDT for C++. Eclipse now should see and should be able to use MinGW C++ compiler!! :-)
So...have fun programming C++! :-)
Pubblicato da
Pelerin-Voyageur
a
6:57 AM
0
commenti
Etichette: c++, eclipse, programming, system administration, Windows, Windows Vista
Eclipse: How to get rid of the squiggly orange line in C++ editor
Problem: Using the Eclipse IDE with C or C++ code I have an annoying orange squiggly line throughout my code
Solution: Changing the C/C++ Indexer Markers options
Using the Eclipse IDE to programming C++ code, when an "include file" statement is not resolved, it is marked with an orange question mark and the whole code in the file we are editing are understriked with an orange squiggly line, as shown in the picture below.
It's really annoying, in particular when we are editing a file outside the real environment where the code will be compiled, and we already know that the included files are not physically joinable in that moment ;-)
So, in order to get rid of this squiggly orange line, just open the menu Window --> Preferences --> General --> Editors --> Text editors --> Annotations, look for the orange question mark symbol called "C/C++ Indexer Markers" and check out the "Text as" option, as shown in the figure below
In this way you can keep the orange question mark warning symbol in the Eclipse C++ editor, telling you that the "include file" statement is not working; but you can get rid of this annoying orange squiggly line, as shown in the figure below, and you get back a clean code! :-)
Pubblicato da
Pelerin-Voyageur
a
2:57 AM
0
commenti
Etichette: c++, eclipse, programming
Friday, October 24, 2008
Subclipse error: Svn can't create tunnel. Configuring SVN+SSH connection on Windows Vista
Good morning!
Yesterday I wanted to install the beautiful Eclipse IDE on my new Windows Vista laptop. Everything went fine. I also installed Subclipse, the interface to the "Subversion" Version Control System, in order to access my code in the repositories on the remote machines of my Insitute.
Everything went fine again, but then, when I wanted to set up a SVN+SSH connection to checkout my code from the remote machine, I got this error:
The system cannot find the file specified.
svn: Can't create tunnel: The system cannot find the file specified.
Looking on Internet I found a solution for Windows XP, that I had to modify a little bit. Here the solution.
The problem is that you have to specify the path of your SSH client. You can use the classical PuTTY or Plink, but I prefer to use the TortoisePlink, the modified version of Plink contained in the excellent TortoiseSVN package. Using the TortoisePlink client you will be prompted for your username and password without opening an ugly CMD window (the command line window) every time.
So, let's say you have already installed the SVN client, you have now to modify the config
file.
In Windows Vista this file is stored in the hidden folderC:\Users\[username]\App Data\Roaming\Subversion
There you find the file named config
. Open it with an editor (for instance Notepad) and look for the string[tunnels]
this line must be uncommented (no hash #
symbol at the beginning of the line). Then you have to modify the line below, to set the right path to your SSH client# ssh = $SVN_SSH ssh
Let's say you installed the package TortoiseSVN at C:\Program Files\TortoiseSVN
so you can leave commented the line # ssh = $SVN_SSH ssh
and you can add this line just below it:ssh = C:\Program Files\TortoiseSVN\bin\TortoisePlink.exe
Done!! :-)
Now you should be able to connect to your remote site with SVN through a secure SSH tunnelling connection.
And, as always, let me know if you have some problems! ;-)
Pubblicato da
Pelerin-Voyageur
a
10:36 PM
3
commenti
Etichette: eclipse, Subversion, svn, system administration, Windows Vista
Sunday, October 12, 2008
Finalmente risolto il problema di Windows Vista con la connessione di rete wireless
Erano mesi ormai che nella nuova casa avevo questo problema con Windows Vista: ogni tanto, senza ragione apparente, perdeva la connessione wireless. Magari per dieci ore tutto funzionava...poi all'improvviso...PUM! L'iconcina della rete mostrava una bella "X" rossa e non c'era piu' verso di far rivelare a Windows la rete wireless di casa. Cercando di fare il refresh delle reti disponibili, appariva semplicemente la scritta "no wireless networks found in range". Solo un hibernate o un restart del computer risolvevano il problema. La rete poteva "cadere" in un momento qualsiasi, dopo due minuti come dopo 3 ore, senza un motivo apparente.
E il problema non era del router, perche' con Windows XP la rete restava bella visibile e funzionante.
Oggi ho voluto spulciare un po' su Internet, e alla fine ho trovato la soluzione sul blog di un ragazzo norvegese, che qui ringrazio ;-)
http://www.catonett.com/blog/archives/194
Nei commenti al post ho poi scoperto il link alla pagina Microsoft ufficiale:
http://support.microsoft.com/kb/928233
In pratica bisogna modificare (aggiungere) una chiave del registro di sistema per far si che Vista non usi un impostazione di rete relativa al DHCP, il protocollo che assegna gli indirizzi di rete in modo dinamico ai computer che richiedono la connessione al router.
Ora ho provato a seguire la procedura descritta nei due post...vediamo se funziona!
Speriamo di si! ;-)
Pubblicato da
Pelerin-Voyageur
a
10:21 AM
0
commenti
Etichette: system administration, Windows