Author: Dfg

  • Tips For Linux Newbies

    Tips For Linux Newbies

    I would like this thread to become a compilation of various tips and tricks Linux newbies usually learn through much cursing and reading countless man pages and forums. This is meant to save people time when creating a working Linux system. I’m primarily focussing on desktop configurations myself, but I don’t mind if you add server tips as well. I’m still learning about Linux every day, so if you do not agree with what I wwrite, feel free to comment.

    First of all, to the newbie: Linux is not Windows. No, you don’t need to read this whole rant, and no, I don’t agree with everything it says. It comes down to the fact that Linux is completely different from Windows. Linux is made by coders to do what they want it to do, not what the majority of people on this planet want. Because of that, it’s often more difficult to get something going, but once it’s up and running it usually works very well. If you don’t have any technical knowledge and don’t want to learn about computers, stay away from this thread; and IMO, stay away from Linux.

    A little joke to illustrate my point:
    *What do Linux users actually do with their computer?
    -They spend weeks configuring it so that if they actually had to get some work done they could do it, and then they reformat and start again with a new release / distribution.

    That’s not exactly true, but it is true that Linux generally takes more work to get up and running than Windows. It’s like using lego versus playmobil: half the fun is in building things, but you can’t actually play with it the way it comes from the store.

    I’m going to assume the people who read this thread know at least the basics about the difference between hardware and software, what the main components in a computer are and have already read a bit about Linux. If not, feel free to start reading anyway and google anything you don’t understand.

    First things first: partitioning your harddrive.

    Partitioning your harddrive correctly is very important. It’s difficult to change your partition layout once your system is installed without breaking everything, and a good partition layout will make your system perform a lot better. Most distributions use a really shitty default partition layout, so make your own.

    Here is the general layout I use (for a desktop system):
    sda1 = swap = 512 Mb = swap
    sda2 = /boot = 64 Mb = ext2
    sda3 = / = 8 Gb = ext4
    sda4 = /home = rest of the disk = ext4

    swap: Swap space is virtual RAM, when you run out of RAM your OS starts filling your swap space. Make sure your swap partition is always the first partition on the disk. If swap is necessary it is accessed often so you want to put it on the fastest sectors of your harddisk. As your harddisk spins at a constant rate, the outer most sectors are read and written to faster, and harddisks are filled starting from the outside. Wether you need a swap partition or not is a huge debate. In my opinion, any desktop with at least 2 Gb of RAM does not need swap space, so modern computers don’t need it. On hardware with less RAM, use once or twice your RAM size, don’t go making a 2 Gb swap partition if you have 1 Gb of RAM, that’s ridiculous IMO. If you have multiple harddisks, devide your swap over the first sectors of all your harddisks, this makes it a tiny bit faster still. EDIT TO ADD: It seems hybernate puts everything in Ram in your swap partition, so it might be necessary to use a swap partition at least as big as your RAM to make sure hibernate functions properly. Will add when I figure out if and how every distro (well, at least the distro’s I care about) does this.

    /boot The /boot folder is where Linux stores its kernel and the bootloader if it’s too big to fit in the MBR of your harddisk. Putting your kernel on a seperate tiny /boot partition formatted in ext2 reduces your boot time with 10 – 30 seconds. I don’t know the exact technical details of why it works, but it works; just make sure it’s not too big and it’s ext2. I don’t know why none of the distros I tried include this in their default partition layout, it doesn’t waste space and it’s a huge perceived performance boost when your system boots a lot faster.

    / The root of your system. This is where your whole operating system and all your applications will go (unless you make an even more advanced partitioning scheme, but that’s only really necessary on servers). For most distros, 8 Gb is enough, unless you’re going to install a lot of very big applications. For a small distro (like Crunchbang, my favorite lightweight easy to use distro) 4 Gb is plenty with room to spare for installing applications. If you’re using Gentoo (another distro I love) and intend on using Gnome or KDE you need at least 15 Gb of space in / ; preferably 20 Gb. Gentoo wastes a lot of space because it keeps the source of everything you install so you don’t have to redownload it when you want to reinstall it, and the compiling itself can also use up a sizeable amount of harddisk space. Ext4 because it’s the best.

    /home is where all your personal files go. Documents, movies, music, pictures, it’s all in /home, so make this partition the biggest. Also ext4 because it’s the best, unless you want to access it from within Windows, in that case, make it NTFS.

    Most distros have a graphical installer which makes it very easy to make your own partition layout, so do it. Assigning the mountpoints is usually nothing more than selecting them in a dropdown menu.

    Once the installation is finished, edit /etc/fstab and add the options noatime,nodiratime (use relatime if any of your applications needs acces times to work properly – unlikely btw) to any ext3/4 partition and the option noauto to your /boot partition. And remember to mount it if you’re going to change your bootloader or your kernel. This way you avoid the file system check which happens automatically on any ext2 partition after x ammount of mounts. As your boot partition is read without mounting it during bootup and usually never written to, this check is not necessary.

    More is for later.


    Short guide to compiling from source

    So for one reason or another you’ve downloaded an application as source instead of using your distro’s repositories. Either it’s not available in the repositories or it’s not the right version or you just wanna try something different (I personally don’t see any reason not to use the repositories if they have the version you want because they often add little patches to make an app work better with your specific ditribution, but you can do whatever the hell you want, that’s why you’re using linux in the first place). Now you’re staring at that darn tarball and you’re asking yourself “Now how do I install this thing? Clicking won’t work, drag-and-dropping to my programs menu won’t work?” Really simple, but there are a few things you should watch. Let’s say you wanna install application Duck and you’ve opened a console and navigated to the folder with the tarball (which is an archive, like a .zip / .rar file in case you’re wondering what that thing actually is) in it.

    Untarring the tarball:

    If the tarball ends in .tar.bz2 use
    tar -xvjf ./duck-2.0.6.tar.bz2
    If the tarball ends in .tar.gz use
    tar -xvzf ./duck-2.0.6.tar.gz

    Now you should have a folder named duck. Move in that folder, and here’s the part most people forget: Read the included textfiles. Read any file titled “help”, “installing”, “readme”, “release notes” etc., any file meant for you to read it. Or at least skim trough them. Those files will tell you about any dependencies you need to install first (and the developers of this awesome app didn’t bother to mention on their webpage or just forgot to mention), known problems with certain distributions / configurations / other installed applications / other things you need to take care of to actually get it working.

    Compiling and installing the application

    Now you’re in the recently untarred folder, you’ve scrutinized all the files you’re supposed to read / ignored them all (whatever – linux is all about choice, innit?) and installed any dependencies. Now you just type these commands:
    ./configure
    make
    make install
    make clean

    The last three commands can be combined into one:
    make install clean

    The “make clean” command is often forgotten. It deletes any files created for the compilation and installation process which aren’t needed for the installed application to run. Some people like to keep the installable executables so they don’t need to recompile while reinstalling an application. I like to keep my drive free of clutter, so I always issue a “make clean” after the installation is done; I’ve never had to install really large applications from source so compile times are not much of an issue to me. It’s up to you.

    Most problems during installing from source – like most problems in Linux in general – arise because people don’t take the effort of reading the files they should read before installing. It can be a pain, especially if it’s a file full of coders patting their own backs with nothing useful in it. However, unlike most Windows readme files, there’s often very useful information in readme files in Linux.


    In this thread I’m going to explain the basics of wine. I think it would be useful if we all post the apps we have runnng under wine and what we did to get it running.

    What is WINE and does it work?

    WINE is an attempt to write an open source windows API from scratch for linux. This involves “blackbox reverse engineering” – meaning they have no access to code. The entire thing is written by prodding and poking at MS binaries and attempting to copy the response. As a result it may not always work. What works and does not work depends on what calls the software makes and whether or not wine has implemented that call.

    How do i Install WINE?

    Install wine the same way you install any other app on you distro. Some distros delay upgrading to newer versions of WINE due to regression issues. If you wish you can also compile it from source.

    Most of the time people use winetricks along side of wine. winetricks is a script that downloads MS libraries that are “freely redistributable” and installs them (with WINE). for example MS office spellcheck will not work without installing the “Microsoft Jscripy library” and so on.

    you can download winetricks from:
    Winetricks

    you will need to set it as an exectutable before running it, This can be done with:
    chmod +x /path/to/winetricks

    How do i run apps with WINE?

    it can be as simple as:

    wine /path/to/executable.exe

    but wine is not perfect, in many cases you will have to override dlls and install libraries with winetricks. It is not as difficult as it sounds but sometimes you may have to sacrifice many animals to various gods.

    you can see exactly how well WINE handles your app by searching: WineHQ

    for the sake of this tutorial

    we will install MS office 2007

    . The process is similar for all apps

    wine appdb says office installer “works fine”. NOTE: This does not mean it will run, it only means it will successfully install, we will have to do more tweaking before it can run.

    The first step is to install MS office 2007
    you can install msoffice with:

    wine /path/to/office/setup.exe

    run the setup as normal type in your CD key ( 🙂 ). It will install the same as windows. After it has finished installing (you can close the installer) run:

    winecfg

    This is the wine configuration utility, here you can set overrides to various DLLs. For this particular app we will have to do a few things to get it running.
    reading the wine appdb, we have to:

    > set riched20.dll to “native(windows)”
    we do this by going to the Libraries tab in the area labeled “New override for library” type in riched20.dll and click on Add. click on the Edit button. Set it to Native (Windows) and click OK.

    > set usp10 to ‘native,builtin’ (done the same way as above)

    In this case we will have to install jscript to get spellcheck to work. Making sure winetricks is set to exectubale – we type in a new terminal window:

    /path/to/./winetricks wsh56js

    This will install Jscript for you after that is done you can run MS office on linux.

    other stuff

    The above process of installing MS office is the same way you install all apps under WINE – sometimes you will have to muck about with winecfg and winetricks quite a bit longer (WINE appdb will tell you exactly what to do)
    Sometimes wine appdb can be a bitch to decipher but if you app is even halfway popular someone has probably blogged it.

    Windows app fonts look terrible under linux if you don’t have MS fonts installed. you can install them here: Corefonts

    If you want an easier WINE way and don’t mind paying there are several supported GUI wine installers:
    cadega – supported wine for games
    crossover – suppoted wine for apps

  • A Basic Guide To Gathering Dox

    A Basic Guide To Gathering Dox

    Firstly, I’d just like to say that this can be improved. Ill write it as well as I can though.

    So, for whatever reason you may have, you find yourself needing to get some personal information on somebody. But how do you go about doing it?

    Firstly, you need to use the information you already have. If this is someone you know IRL, then you will have a name. However, if this is someone you know on the internet, then you will most likely have a USERNAME to go by. This is your starter.

    Usernames

    With the internet being a thing used by almost everybody in today’s world, a LOT of people have accounts on websites/forums which require a username. To keep things simple, a hell of a lot of people use the same username for every website they sign up to. This however, makes our job easier as well. The first thing I usually do when collecting someone’s info is to enter their username into a search engine. The following is a list of the one’s which I find the most helpful.

    Google
    Pipl – Highly recommended!
    Zuula

    So, your search should have brought up a whole bunch of shit related to that username. This should, hopefully, be the workings of that particular person on the internet. It is up to you to sift through the information that you find. Remember, you are looking for ANYTHING of interest, including the following;

    – Name
    – General Location
    – Contact details of any kind (MSN, AIM, Email address, phone number, house number)
    – Social networking sites

    What should I do with the basic information?

    Well, you use it to find MORE information, of course! This is how you get the ball rolling, and you will be on your way to gathering more and more information. Simply rinse and repeat the previous method of gathering information – By searching the internet for it.

    You soon should find that you are building up a little document (Seriously, save it in a txt file) of information, which all slots together.

    How can I get an address from this?

    Getting an address couldn’t be easier, with the help of Whitepages (US), or BT residential (UK), AS LONG AS YOUR SUBJECT IS ACTUALLY IN THE DIRECTORY. You will need to know the general location of your subject, and their surname. A full name of the house owner sometimes helps by a metric shit ton, as many people with the same name can live in a certain area.

    So, simply enter the details, and let the internet do the rest. It should bring up an exact address, complete with phone number and everything.

    Finding Facebook Accounts

  • Compound Microscope

    Compound Microscope

    A compound microscope is an invaluable tool for viewing microscopic specimens, both biotic and abiotic. In contrast to single-lens microscopes, these use multiple lenses to provide an improved viewing resolution and to allow for illumination techniques.

    Parts of the compound microscope

    The following image will outline the main parts of the compound microscope:

    • Eyepiece – This is where you look through. It usually provides 10x magnification.
    • Objective Turret – This holds the objectives and allows them to be rotated for different levels of magnification
    • Objective lens – Contains lenses with each separate objective lens providing a different magnification. Standard lenses: low power (3.2x), medium power (10x), high power (40x), oil immersion (100x)
    • Coarse Adjustment Knob – Makes large changes in the focus
    • Fine Adjustment Knob – Makes small changes in the focus
    • Stage – Has brackets to hold slides in place for viewing. Also has a hole for illuminating light to pass through
    • Light source – Usually can be dialed around for varying levels of brightness
    • Condenser & Diaphragm – The condenser focusses the light while the diaphragm controls how much light gets through
    • Stage Control Knob – Allows the stage to shift in four directions

    Setting up a slide

    There are two ways to set up a slide for viewing depending on the subject of study. As a rule of thumb, almost anything that is dry can be placed directly onto a clean slide under the objective lens of the microscope and viewed. For micro-organisms, a wet mount will have to be prepared:

    • Clean a slide using hot water.

      Do not use soap as it can be toxic to some organisms.

      Dry the slide.

    • Use a pipette to remove a small sample of the liquid containing the organism and place a drop on the centre of the slide. If the organism is not in liquid, add a drop of water. Most micro-organisms thrive in liquid.
    • Place a coverslip on top of the drop. Make sure there are no air bubbles.
    • Blot up any excess liquid and dry the bottom of the slide.
    • The slide is now ready for viewing.

    Setting up the compound microscope

    • Place the microscope on a steady, flat surface.
    • Turn the light source on. Keep it at a medium brightness. Too low and it will be hard to see, but too high and certain organisms may die.
    • Place the slide onto the stage and clamp it down with the brackets.
    • Rotate the objective turret so that the low power lens is in place.
    • Rotate the condenser away from the path of the light. It is only used for higher magnifications.
    • Raise the stage as close as possible to the objective lens, but not touching.
    • Use the coarse focus to focus on the specimen. This will move the stage away from the lens.
    • Use the fine focus to further clarify the image.
    • Adjust the eyepieces so your field of view is only one circle.
    • Adjust the contrast using the diaphragm so you can see different parts of the specimen more clearly.
    • Rotate the medium power lens into place. You should only need to use the fine focus to adjust the focus.

    Köhler illumination

    To provide the best possible image, the lenses must be correctly lined up. When done properly, this will allow for an evenly illuminated field, a bright image without glare, and minimal heating of the specimen.

    • Make sure the specimen is in focus.
    • Rotate the condenser into the path of the light and raise the condenser as far as possible.
    • Close the diaphragm.
    • Focus on the diaphragm using the condenser’s focus knob. A hexagon with purple or blue edges should appear.
    • Open the diaphragm until the entire field is illuminated.
    • The microscope is now set up for Köhler illumination at medium power.
    • For high power, rotate the high power lens into place and repeat steps 1-6.

    Oil immersion lens

    The oil immersion lens must be used with a layer of immersion oil between the lens and the specimen. The oil has a refractive index similar to glass, which allows for higher magnifications to be used while keeping decent resolution. This is usually only done for non-motile organisms, such as dead ones. At these magnifications levels, it is almost impossible to keep an eye on moving organisms.

    • Focus on the specimen with the high powered lens.
    • Place a drop of oil on the cover slip over the observed area.
    • Rotate the oil immerson lens into place.
    • Bring the lens as close to the slide as possible, then focus by moving away.

      If you focus by moving towards, you may hit the slide

    Estimating the real size of the specimen

    Create a table like the one above. The data on the magnification of the lenses was obtained by reading the labels on the microscope. The total magnification is the product of the eyepiece and objective lens magnifications. The approximate field diameter is measured using a micrometer (slide with microscopic ruler).

    To estimate the size of the specimen, simply estimate how many lengths or widths of the specimen is required to span the field. Divide the field diameter by this number to get the length or width of the specimen.

  • Plasma Speakers

    Plasma Speakers

    Plasma speakers are audio-modulated electric arcs.

    How the hell does it work? Well it’s like this; The arc is a high frequency AC current and it constantly makes a high pitched squeal. But when the frequency is above 18kHz we humans can’t hear it because our ears fucking suck. Since it’s silent quiet we can do what we want with the arc now, and to make music we just need a little modulation.

    WTF is modulation? Well if a 50kHz arc is turned on and off 2000 times a second, we hear a 2kHz tone. Now if we modulate it to the tune of music, well then music comes out. In the below circuit the 10kΩ pot controls the arc’s frequency. A lower frequency typically means higher voltage and a higher freq means more amps. The thing works best around 40-60 kHz. Also, the mosfet doesn’t have to be a 260; It can be any mosfet that can handle at least 100 volts, and more than 30 amps. It must be heatsinked very well with plenty of thermal goop though because it gets really fucking hot. You can even put the heatsink in a bucket of water, provided it doesn’t make contact with the fet’s pins.

    How do I make one? I suck at soldering…

    Also, too loud an audio signal will fry the chip. You’ll need a quiet signal, a really quiet one. Just turn the volume all the way down, then turn it up. When the music starts to distort that’s the max volume. The ground wire gets really hot. Hot enough to burn if it’s iron. You’ll need something with a lot of thermal mass such as a screw.

    By Katzenklavier

    Discuss this.

  • Getting Through A Fence

    Getting Through A Fence

    When trying to enter or exit areas, a fence may be in your way. Here are several ways to get past it.

    Climb over the fence

    This works best if the fence does not have barbed wire on top. Simply climb over, or jump over if it’s low enough, and you’re through. If there are tools nearby such as ladders or crates, use them if wanted.

    If there is barbed wire, it can get tricky. There are several scenarios here:

    • Straight lines of barbed wire, noncontinuous due to a change in elevation. Find the break and climb over from there. The higher point will offer support in climbing over the lower point.
    • Straight lines of barbed wire, continuous, no height change. Find the supports for the barbed wire, use them to assist you and prevent falling. Avoid touching the barbed wire.
    • Angled barbed wire. This is tough, but the same method as #2 can be applied, but use much more care. Avoid at all costs.
    • Looped razor wire. Do not attempt to climb over this. More on this later.

    CAUTION: Take extreme care when climbing over barbed wire. Cuts can lead to infections. Tetanus is also not fun.

    Cut through the fence

    Use wire cutters to cut through a chain link fence, or a tool like an axe or sledgehammer to smash through wooden fences. This leaves obvious marks of unauthorized entry, so take care. You can try to put it back into place to hide the damage, but it will be discovered eventually.

    Bypass barbed wire/razor wire

    Couple ways to do this:

    • Use wire cutters to cut through. This leaves obvious marks of unauthorized entry.
    • Drape a thick cloth, like a rug over the wire and climb over.

    Electric Fences

    Avoid these unless you’re wearing a rubber suit. If you can find a switch to turn it off or find a way to disconnect it, proceed as you would with a normal fence.

    Methods less used

    • Drive through the fence with a car
    • Explosives
    • Fly over in a plane/helicopter
    • Parachute
    • Springboard
    • Dig underneath

    Now that you’ve gotten to the other side of the fence, take care to watch out for any other security features the location might have. Also make sure that you have a way to get back across the fence or have another exit strategy planned.