This is late, but you know what they say... better than never, right?
CodeBlocks has finally released a new version. For ages they weren't doing releases, just nightly builds. When I was working with Shlomi Peleg at SparkThing this app was a staple of our work environment. I haven't used the new release yet, but Peleg says that it's great.
So, if you write C++ and want an excellent open source IDE to work in, check it out.
Wednesday, April 30, 2008
Monday, April 28, 2008
Cool iPhone Thingy
We had a training at work today all about how the GSM phone system works. At the end, the speaker showed us how to find out all sorts of information about your GSM connection on an iPhone. You can see information about a call in progress, network information, which cell phone towers your phone can see, information about your GPRS (internet) connection, and what firmware version you are running.
One of the cool things about this is that you can see how walking around in a room, say, makes your connection to any given tower stronger or weaker.
If you have an iPhone, check it out. Dial *3001#12345#* then hit call.
And no, I don't have an iPhone. The company has a few for testing our apps, so we got to play with those. My current phone is a Nokia N80.
One of the cool things about this is that you can see how walking around in a room, say, makes your connection to any given tower stronger or weaker.
If you have an iPhone, check it out. Dial *3001#12345#* then hit call.
And no, I don't have an iPhone. The company has a few for testing our apps, so we got to play with those. My current phone is a Nokia N80.
Sunday, April 13, 2008
Computing Everywhere?
A friend of mine hates the state of computing today. He points out that it's developed by geeks for geeks, and the rest of the world has to bend to our twisted way of thinking. Really, computers should be more than just ubiquitous, they should be invisible. They should bend to the needs of humans, not the other way around.
One of the areas where this is actually making strides forward is in the area of always accessible data. As my friend would say, "Why should I have to manage three or four address books? I shouldn't! The computer, my home phone, my cell phone, and all of the apps on them should be able to get what I need from one central place where I keep that data." So true.
APIs for cross-application development and mashups are getting us closer to that kind of thing, and tools like OpenID and OAuth are also moving us in the right direction. But, what about that data thing? How can I have my data in one place?
One possibility is the advent of serious online storage solutions and wifi based file sharing through applications like *Fring. There's a blog article about just that at the Fring site called "Is Fring the missing link for mobile online storage services?". Yeah, I think that it can be.
We're still a long way from where my friend dreams, but I truly believe that we are in the midst of an evolution that is heading in that direction. One side of me says that we shouldn't be too impatient because all of these things are moving forward one step at a time, but on the other hand, it's precisely the impatience of developers and entrepreneurs that is pushing us forward in this evolution so quickly.
The next time you look at the design of an application you are working on, ask yourself: "How is this going to tie in with the computing needs of the user at home, on their smart phone, in the car... and everywhere else they are computing?" And "Can we make it work together with a single data source and invisible syncing?" Because if you can deal with those two issues now, you are going to put your app ahead of the curve and make it that much more invaluable to your end user. Which might just be yourself. (or me!) ;)
*Just so you know: I work for Fring now. :)
One of the areas where this is actually making strides forward is in the area of always accessible data. As my friend would say, "Why should I have to manage three or four address books? I shouldn't! The computer, my home phone, my cell phone, and all of the apps on them should be able to get what I need from one central place where I keep that data." So true.
APIs for cross-application development and mashups are getting us closer to that kind of thing, and tools like OpenID and OAuth are also moving us in the right direction. But, what about that data thing? How can I have my data in one place?
One possibility is the advent of serious online storage solutions and wifi based file sharing through applications like *Fring. There's a blog article about just that at the Fring site called "Is Fring the missing link for mobile online storage services?". Yeah, I think that it can be.
We're still a long way from where my friend dreams, but I truly believe that we are in the midst of an evolution that is heading in that direction. One side of me says that we shouldn't be too impatient because all of these things are moving forward one step at a time, but on the other hand, it's precisely the impatience of developers and entrepreneurs that is pushing us forward in this evolution so quickly.
The next time you look at the design of an application you are working on, ask yourself: "How is this going to tie in with the computing needs of the user at home, on their smart phone, in the car... and everywhere else they are computing?" And "Can we make it work together with a single data source and invisible syncing?" Because if you can deal with those two issues now, you are going to put your app ahead of the curve and make it that much more invaluable to your end user. Which might just be yourself. (or me!) ;)
*Just so you know: I work for Fring now. :)
Wednesday, February 13, 2008
Woops! MySql didn't start when the server rebooted!
One of my customers had this problem today. I got a text message, "Lisha! Can you look at the server and tell me why mysql isn't working? I rebooted the server and now the website has an error. Something about Error #2002 and the mysql.socket."
It turned out that when they rebooted their LAMP server, the mysql demon didn't turn on with the rest of the services like the apache http demon. Luckily, this is easy to fix. I ssh'd to their server and got to work.
First, I checked to see if my hunch was right:
Yipes! Yup, you have no bananas (or mysql, as the case my be).
Next, I ran the mysql initialization script:
Then check to see if it worked:
Ah, yes. All better!
Next time, we can make mysql demon startup at boot time. On a Red Hat type system you can run the following code as root (or via sudo) to run the initialization script automatically at boot:
It turned out that when they rebooted their LAMP server, the mysql demon didn't turn on with the rest of the services like the apache http demon. Luckily, this is easy to fix. I ssh'd to their server and got to work.
First, I checked to see if my hunch was right:
mysqladmin ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
Yipes! Yup, you have no bananas (or mysql, as the case my be).
Next, I ran the mysql initialization script:
/etc/init.d/mysqld start
Starting MySQL: [ OK ]
Then check to see if it worked:
mysqladmin ping
mysqld is alive
Ah, yes. All better!
Next time, we can make mysql demon startup at boot time. On a Red Hat type system you can run the following code as root (or via sudo) to run the initialization script automatically at boot:
ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S98mysql
Monday, February 11, 2008
Collecting mail from external servers on Zimbra
Do you have Zimbra users who want to pull mail into their Zimbra accounts without having to press "Get Mail" or "Get External Mail" every time? It's easy.
In the Zimbra server's command line, running as user zimbra, try:
If you get a response, the number it gives you is the number of seconds between checks of the external mail boxes. If you don't get any response, that means that the zibraDataSourcePollingInterval isn't set yet. Set it like this:
Now the external mail accounts will be checked every 3 minutes.
But wait!! There's a problem. If your users created secondary accounts before you did this, their mail might not get picked up on schedule. (This is certainly the case as of 5.0.0_GA_1869.) So, you need to set the polling interval for each of your users' data sources manually -- or with a script that you write yourself.
For each user, check what datasources they have now:
where myuser is the name of the user, of course. Then, for each user modify the data source with the command:
For example:
Notice the \ and space in "Migration\ Account" in my example. The name of this data source is "Migration Account". If you have spaces in your data source name like I do here, then you need to use the backslash (\) to escape the space. Otherwise, the system thinks that the next word is part of the next option or command in the line. (This is pretty standard *Nix-ish behavior, but if you're a newbie it can throw you off.)
(The info for this post was found at http://www.zimbra.com/forums/installation/11487-solved-receiving-mail-multipop3-server.html and through personal experience with this problem last week...)
In the Zimbra server's command line, running as user zimbra, try:
zmprov gc default | grep zimbraDataSourcePollingInterval
If you get a response, the number it gives you is the number of seconds between checks of the external mail boxes. If you don't get any response, that means that the zibraDataSourcePollingInterval isn't set yet. Set it like this:
zmprov mc default zimbraDataSourcePollingInterval 180
Now the external mail accounts will be checked every 3 minutes.
But wait!! There's a problem. If your users created secondary accounts before you did this, their mail might not get picked up on schedule. (This is certainly the case as of 5.0.0_GA_1869.) So, you need to set the polling interval for each of your users' data sources manually -- or with a script that you write yourself.
For each user, check what datasources they have now:
zmprov gds myuser |grep DataSourceName
where myuser is the name of the user, of course. Then, for each user modify the data source with the command:
zmprov mds [username] [dataSourceName] zimbraDataSourcePollingInterval [seconds]
For example:
zmprov mds myuser Migration\ Account zimbraDataSourcePollingInterval 180
Notice the \ and space in "Migration\ Account" in my example. The name of this data source is "Migration Account". If you have spaces in your data source name like I do here, then you need to use the backslash (\) to escape the space. Otherwise, the system thinks that the next word is part of the next option or command in the line. (This is pretty standard *Nix-ish behavior, but if you're a newbie it can throw you off.)
(The info for this post was found at http://www.zimbra.com/forums/installation/11487-solved-receiving-mail-multipop3-server.html and through personal experience with this problem last week...)
Thursday, February 7, 2008
Locking Down Root
Having an active root user is generally not a good thing. If the machine is used by lots of people and several individuals do superuser tasks under the root user, you have no way to track who did what in the event that someone decides to get evil. And of course, hackers like to get root access, because it lets the do anything that they want. You don't want that, so let's lock root up.
First, make sure that you have super user abilities when root is locked. If you don't already have sudo access, use root now to add yourself into the /etc/sudoers file. (I'll write an article about that soon. In the meantime, use
Now, lock root. Get out of root, if you are in it already, and as a user with sudoers privileges type
Check your work with
You should see something like
The option -S gives you the status of a user. It gives you the user name, then the status (L = locked, NP = no password, P = password), the date of the last change, and then the minimum age, maximum age, warning period and inactivity period for the password.*
Root is now locked. You can't log into root directly any more, and will have to run superuser tasks through sudo. There is still a cheater way around it, though. You can
and then you will be root again. (I'll explain how to fix that in the sudo article.)
* Minimum age for a password says that you can only change the password ever so many days. Maximum age says that you have to change your password every so many days. Warning period is how long before maximum age is reached that the system should start warning you that you have to change your password. Inactivity period is how long after a password is expired that the login should be completely locked out. If you don't change your password before maximum age is reached, then the system will generally let you log in and immediately change your password before moving on. Once you've hit the days in inactivity period, though, you don't get a chance. It just won't let you in at all at that point. All of these ages are expressed as a number of days.
First, make sure that you have super user abilities when root is locked. If you don't already have sudo access, use root now to add yourself into the /etc/sudoers file. (I'll write an article about that soon. In the meantime, use
man sudo
to learn more.)Now, lock root. Get out of root, if you are in it already, and as a user with sudoers privileges type
sudo passwd -l root
Check your work with
sudo passwd -S root
You should see something like
$ root L 09/11/2007 0 99999 7 -1
The option -S gives you the status of a user. It gives you the user name, then the status (L = locked, NP = no password, P = password), the date of the last change, and then the minimum age, maximum age, warning period and inactivity period for the password.*
Root is now locked. You can't log into root directly any more, and will have to run superuser tasks through sudo. There is still a cheater way around it, though. You can
sudo su
and then you will be root again. (I'll explain how to fix that in the sudo article.)
* Minimum age for a password says that you can only change the password ever so many days. Maximum age says that you have to change your password every so many days. Warning period is how long before maximum age is reached that the system should start warning you that you have to change your password. Inactivity period is how long after a password is expired that the login should be completely locked out. If you don't change your password before maximum age is reached, then the system will generally let you log in and immediately change your password before moving on. Once you've hit the days in inactivity period, though, you don't get a chance. It just won't let you in at all at that point. All of these ages are expressed as a number of days.
Creating A New *Nix User
The easiest way to create a new user on the command line is:
But that's not always enough. Let's say, for instance that you want people to change their password the first time that they log in and then again every three weeks. Let's set georgette up like that:
Here's what we just did:
sudo = "superuser do" (do this as if you are root)
add user georgette with the comment (-c) "Georgette Userina" (-c is usually used for the user's full name)
give georgette a password she can use the first time she logs in
expire georgette's password immediately (so she has to change it when she next logs in) and then expire (-x) her password every 21 days.
Need a short term user? Maybe you have a contractor working with your company for a short time or a friend that's hanging out at your house for the next two weeks and needs access to your Ubuntu desktop while he's there. Here's how to do it:
Here we use the -e option with useradd to expire the account after March 10, 2008.
If you do most of your new user adds with the same special options, you can set those things as default in the file /etc/login.defs
sudo useradd george
sudo passwd george
But that's not always enough. Let's say, for instance that you want people to change their password the first time that they log in and then again every three weeks. Let's set georgette up like that:
sudo useradd georgette -c "Georgette Userina"
sudo passwd georgette
(give her a throw-away password)
sudo passwd -e -x 21 georgette
Here's what we just did:
sudo = "superuser do" (do this as if you are root)
add user georgette with the comment (-c) "Georgette Userina" (-c is usually used for the user's full name)
give georgette a password she can use the first time she logs in
expire georgette's password immediately (so she has to change it when she next logs in) and then expire (-x) her password every 21 days.
Need a short term user? Maybe you have a contractor working with your company for a short time or a friend that's hanging out at your house for the next two weeks and needs access to your Ubuntu desktop while he's there. Here's how to do it:
sudo useradd sammi -c "Sammi Shortimer" -e 2008-03-10
Here we use the -e option with useradd to expire the account after March 10, 2008.
If you do most of your new user adds with the same special options, you can set those things as default in the file /etc/login.defs
Subscribe to:
Posts (Atom)