Ceci est une ancienne révision du document !
When going through last month's survey results, I was pleasantly surprised to see a number of interesting suggestions, and what seemed to be an overall positive response to C&C. However, I also noticed a few suggestions and requests for topics I have already covered. As such, I decided I'd devote this article to directing those to the past issues, and to also answer some of the quicker questions that were aimed in my direction.
LaTeX: I covered this in C&C in FCM#50 and #52 – where 52 was aimed more at Asian languages in LaTeX.
Virtualbox: Someone asked for advice on how to install Virtualbox in Ubuntu 12.04 because they were having issues. I had a short-lived virtualization series in FCM#38-45, but the short answer is, go to this web page: https://www.virtualbox.org/wiki/Downloads
Install the current version of VirtualBox for Linux hosts, then the Extension Pack. You have to select the VirtualBox package which corresponds to the version of Ubuntu you are using, and 32-bit or 64-bit.
Automation: A surprising number of you seemed to be interested in writing bash scripts to automate things (either for yourself or for family members). I introduced that topic in C&C in FCM#24, but judging by the response, I'll probably be writing another few articles on that at a later date.
Conky: There were a fair amount of requests on getting started with conky. I have covered Conky in the following issues of FCM (in the C&C column): #44, #45,#46, #48, #51. If you have any particular issues with Conky, feel free to email me about it at lswest34@gmail.com. Please put “conky question” in the subject, and include the output of both lsb_release -a and conky -v
IDEs: Someone asked for a review of IDEs – without knowing exactly what languages you want to develop for, it would be a fairly confusing article. That being said, I did discuss IDEs in FCM#64.
CLI Coloring: A couple of people asked about styling your prompt and terminal. I have discussed this in FCM#27, #35, #36
Command-line “cookbook”: Someone asked for a collection of useful command combinations and I thought it might be interesting to open this up to the readers. If you have a favourite command (or ones you simply find yourself using a lot), feel free to add them to this google doc here: goo.gl/fp09r – please include why the command is useful (i.e. what you use it for). Once we have a list of sufficient length, I'll go through the commands and compile it into an article “cookbook”.
And now, on to some questions that were fairly brief and would not have been enough for a whole article in and of themselves.
Create a folder hierarchy with a one-liner (Bash scripts): First off, this doesn't require a script of any sort. Mkdir (make directory) is the command-line tool Linux offers for this. Usually it will create only a single folder at a time; if you tell it to create a path, it will fail. However, it has a command-line argument “-p” (how I remember this is p=path, so make path, instead of directory), which does exactly what you want. Take this scenario, for example: You want to create a folder Summer in your Pictures folder, with two folders within it called Tahiti and Montreal. This can be done with one single command:
mkdir -p Pictures/Summer/{Tahiti,Montreal}
The -p argument will literally create directories as needed to reach the directories you want to create. So if Pictures or Summer (or both) are missing, they will be created. The only caveat is that you can't put spaces between the commas. You can certainly make names with spaces though, as you can see below:
mkdir -p Pictures/Summer/{“Tahiti 2013”,”Montreal 2012”}
As you can see, you can't place a space between the items and the comma (mkdir understands it as two paths then: Pictures/Summer/{Tahiti 2013 and ./Montreal 2012} – as you can tell, they won't even end up in the same folder). Naturally, this also works on Mac OS X systems, as they offer the typical mkdir command.
Another question I had was to create a bash script to automatically mount a second and third hard drive. Once again, this isn't a Bash problem. Linux offers you a configuration file called /etc/fstab. This is in charge of mounting all your drives on boot-up. It will look something like that shown below.
The following mounts an NTFS drive to /media/Windows while giving permission to access it to the user lswest and all users in the group users. Edit the uid and gid as you see fit. You'll also need to change /dev/sda5 to the correct partition:
/dev/sda5 /media/Windows ntfs-3g uid=lswest,gid=users,dmask=022,fmask=133 0 0
Example of mounting a FAT32 USB stick using UUID – again, change the UUID to the correct one:
UUID=47FA-4071 /home/lswest/USB vfat defaults,noatime 0 0
If you want to use spaces in the paths, you need to replace the spaces with \040 in the file. Once you edit /etc/fstab, you can test to see if it's working by running:
sudo mount -a
If the drives show up where you expect, and you can access them, you're all set. You can check UUIDs by running:
sudo blkid
Or, if you want the UUID for a single drive/partition, you can use:
sudo vol_id –uid /dev/sda2
Replace, of course, sda2 with the actual drive you want.
Lastly, there were a few requests for covering GRUB2. While that would be an article in itself, I felt I should at least offer a little bit of information for those who don't want to wait. For GUI-based editing of some settings, there's grub-customizer: https://launchpad.net/grub-customizer
If you're just after a different theme, they are discussed at the following links:
https://help.ubuntu.com/community/Grub2 http://askubuntu.com/questions/66183/how-can-i-get-some-nice-eye-candy-themes-for-grub https://help.ubuntu.com/community/Grub2/Displays
Hopefully I've answered the questions sufficiently. If anyone has any further questions, feel free to email me at lswest34@gmail.com. Please include “C&C” or “FCM” in the subject line. If anyone has any suggestions for topics I should cover, you're also more than welcome to email me about them. Judging by the survey, it seems a great deal of you have suggestions or questions. The problem with some is that they are too specific for an actual article – but if you email me I can probably set you on the right path to fixing it.