One of the primary purposes of this blog is tutorials and guides in readable formats free of condescension or esoteric terms, so here’s a guide on commands you probably know.

This does NOT replace a working knowledge of Linux built through reading or experience, but should prove helpful in filling in gaps.

1. Disk partitioning:

The majority of Linux installers use a shiny GUI installer now that does all this for you, but it’s still important to know how to work with partitions, especially if you plan to dual-boot.

partition tools:

cfdisk- (my personal favorite)

a semi-GUI partition tool that is fairly self explanatory- you may have to use mkswap and/or mkfs afterward

parted- (second most common)

a far less friendly partition tool released by GNU. Some more picky operating systems will reject fdisk/cfdisk partition tables in favor of this, so it’s worth getting to know.

mkpart: makes a partition from x to y

— Command: mkpart [part-type fs-type name] start end

print: displays the current partition table

quit: exits

There are many other useful tools, but I do not have room to go into them

more on GNU parted: https://www.gnu.org/software/parted/manual/parted.html

also, I suggest using a graphing calculator or a piece of paper to record and calculate partition size and position as you go

2: Connecting to internet (the hard way)

internet configuration tools: ifconfig, iwconfig, wicd, wifi-menu, network-manager,ip-link

*note: this portion of the guide will NOT work on FreeBSD, or some Linux distros

Most distros will have a GUI and a proprietary network manager for that GUI, but it’s nice to know how to do this manually. Also note these programs can be used a number of ways and I am merely writing about how I use them. Also note I am not an expert in these areas.

iwconfig: primarily focuses on the hardware side of connecting. Just the command itself will show all network interfaces/adapters and their status.

iwconfig <interface> essid “network name”: will connect to “network name” without password

type “man iwconfig” for more info

ifconfig: deals more with the software side of networking, the command alone will list network info, such as IP address, subnet mask, etc.

ifconfig can be used similarly to iwconfig to connect to a network.

type “man ifconfig” for more info

ip-link: Not too familiar with this, but I’ve used it to disable and enable the network

ip-link set <interface name> down: will disable the network interface

ip-link set <interface name> up: will enable the network interface

type “man ip-link” for more info

Wicd, Network-Manager, and wifi-menu are separate application that must be installed to your system, but are more efficient and friendly in dealing with networks. Wicd will run in the background and auto-connect to the network of your choice, Network-Manager is the background process that enabled you to use the network icon in the top right in Gnome, and wifi-menu is a minimal menu used for one-time connection to a network.

3. File permissions/management.

Unlike the above commands, the command line is still superior to GUI for file permission and ownership management, since running the x server as root is a security nightmare.

tools for file permissions and management: chmod, chown, ls, cp, mv, ln

chmod: used to change a file’s permissions and access. There are many formats in which permissions may be granted, but I personally find the number one the easiest. It is worth taking the time to memorize.

chmod 777 <file_name>: never do this

chmod 666 <file_name>: never do this

chmod 700: owner and root can do whatever they want with the file, no one else can

it’s split up into 3 numbers: chmod <owner><group><public/other> <file_name>

7 = read, write, and execute

6 = read and write

5 = read and execute

4 = read only

(you will almost never need 2 or 3)

1 = execute only

0 = no permissions

chmod +x <file_name>: make executable

(also, you can make a file inaccessible to root using a command called sunlink, but sunlink may be removed by root so the trick will not usually work)

chown: change file owner

chown <owner> <file>

chown -R <owner> <file>: recursive, changes subdirectory ownership as well

ls: list files in a given directory

ls -a: list all files, even hidden

ls -l: list files and permissions

cd: change directory

cd <path>

ln: used for symlinks

I am not experienced with symlinks (symbolic links), but the command should look like this:

ln -s <source directory> <directory>

cp: copy

cp <path to file 1> <path to file 2>

mv: move

mv <path to file 1> <path to destination>

4. Scripting

This is me being hypocritical, but knowing both Perl and Bash scripting is essential to the advanced Linux user. Documentation on both is available online, and I highly recommend the O’Reilly guide on Perl.

5. Software installation

Although different for each distro, I feel I should cover how installation works. Each distro will have two package managers, or one that functions for two purposes. One will fetch files from online, and get everything for you (yum, apt-get, zypper, pacman, slackpkg, etc.) and one that can install from local packages (rpm, apt, pacman, installpkg). Alternately, some distros use ports, which involves extracting a portsnap, then compiling source code from the ports directory (will allow you to customize more and check source code, but for larger programs will take a very long time)

6. IRC

This is one you don’t necessarily need, but I highly recommend knowing the basics of IRC as most distros have a Freenode channel for free live support.

I personally use xchat, but these commands should be similar if not the same for all IRC clients connected to Freenode-

/msg NickServ identify <password>: will log you in if you registered the nickname you use

/join #(name): will join a channel

typing ctrl+k will let you pick a color for just that line

(ctrl+k)4 hello this line is red: will print out line in red reading “hello this line is red”

7. Mounting

Mounting a filesystem means you create a directory you can then access as if part of your local filesystem.

1. (in terminal) go to /mnt

2. make a directory, can be named anything (mkdir foo)

3. mount the device (mount /dev/sr0 /mnt/foo)

4. go into the device (cd /mnt/foo)

Image

I am relatively new to Linux, but the above skills have gotten me through using just about every distro out there. Enjoy.

 

 

 

Advertisements

Minecraft in Arch Linux

Installing minecraft tomost GNU/Linux distros is easy and a million guides exist on how to do it, but for a more minimal distro like Arch Linux I thought it would be difficult.

I could not have been more wrong.

Nothing completely mindblowing like it being added to pacman happened, but they bothered to make an article in the wiki about it, and it was fairly straightforward.

Happy mining!

Will post again with any problems/fixes, and possibly about installing for FreeBSD

Hello, I heard you have a tech problem. Closely follow these instructions, and your problem will be solved.

Linux/BSD:

Try turning it off and on again

Windows:

Try turning it off and on again

Linux/BSD:

Check for updates that could fix it and report a bug if necessary

Windows:

Safe mode

Linux/BSD:

check your config files

Windows:

Safe mode harder

Linux/BSD:

Chroot in from an outside disc and fix whatever’s wrong

Windows:

Safe mode EVEN HARDER

Linux/BSD/Windows:

Reinstall OS. Quietly weep.

Was sad to see a lack of GNU/Linux in the science community… Though I salute the lone Ububtu user in that one computer lab

Protips on dual-booting:

1.) Use GRUB.

2.) Order is essential- I advice booting the live CD, cutting partitions, then rebooting and installing windows, then going back to finish Linux, and that way you get GRUB right the first time

3.) BACK EVERYTHING UP. You”l have to re install to get it right 99% of the time, and shrinking partitions is nasty business

4.) Things will go smoother with a more minimal Linux distro like Arch Linux, Slackware, or Gentoo, because you have a lot more control over what goes where

5.) Grab a calculator, write stuff down, and get your partition sizes right the first time. Again, resizing partitions is nasty business

Will be bringing laptop and blogging live from UK’s engineering day, hopefully we’ll see Linux in use in science!

Just got a Numark Mixtrack running through Mixxx, an open-source DJ program, and with a Behringer mixer thrown in the mix, I am ready for my gig!

Mixxx is great, though I wish it could detect key signatures… oh well.

Mix installs straight from apt-get or pacman, but on rpm-based distros you’ll need to compile from source (not a big deal)

(Arch users, be sure to get the kernel module: sudo modprobe snd_seq_midi)

There’s no need to pay for thousand dollar software just to blare some tunes, just use Mixxx!

Just installed Arch Linux on my laptop, and am head over heels in love with it. Previously I had to install slackware instead due to UEFI compatibility issues, but on my laptop such things went fine. The command-line network manager is intuitive and easy to use, pacman is the best package manager I have experienced. Arch Linux is also the only “advanced” distro I’ve used which had practical gnome 3 support, which sealed the deal.

The installation process was not easy in the least, but after the port-compiling nightmares of getting xorg running in FreeBSD this felt like a breeze. WiFi card works out-of-the-box, ATI drivers didn’t give me any static, and pacman got gnome3 and xorg in minutes. After installing the rest of my regularly used software, such as xchat, Google Chrome, and VLC, the total install is still around 5GB. Would definitely recommend. The only issue I still have is that the WiFi network manager won’t connect to the gnome3 GUI interface for it, though fixing that is under way.

However, my love for Arch isn’t based in its performance, but in its philosophy. The Arch Way is precisely the way I envision programming and development should be, and is the future of computer science. Patches on top of patches may work to produce behemoth 50GB operating systems like Windows 7, but they will never perform as optimally or elegantly as a patch-free done-right-the-first-time OS like Arch Linux or FreeBSD.

Although I was blown by all else, I was appalled by Arch’s community. More “advanced” distros are notorious for their stuck-up users, which are exactly who I encountered upon seeking help on their Freenode channel. The documentation was very complete and well-written, so I was able to avoid asking for help too often, but doing so was not a pleasant experience.

More on the Arch Way: http://wiki.archlinux.org/index.php/The_Arch_Way

(P.S. I wrote this article in Vi, just for whimsy)
(or at least the first draft, I unfortunately do not know how to publish directly to wordpress via command line)

Vi or Emacs is an essential for those planning to use GNU/Linux or BSD for any length of time.

I used to think otherwise, but Vi has just such amazing commands, like movement between corresponding parenthesis, on-the-fly macros, and just more efficient control in general.

The “awkward” goes away instantly if you just pretend “command mode” is the same as holding down the CTRL key.

this is the best guide I’ve seen on Vi: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

Now have working ssh server for tunneling around internet restrictions, and encrypting traffic. Viva la revolucion!