Things let1an likes Explore more popular stuff on Tumblr

    1. Source: niknak79
      1. Source: cutlerish

        cutlerish:

        C

        You shoot yourself in the foot.

        C++

        You accidently create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can’t tell which are bitwise copies and which are just pointing to other instances of you, saying “that’s me over there”.

        FORTRAN

        You shoot yourself in each toe, iteratively, until you run out of toes, then you read in the next foot and repeat. If you run out of bullets, you continue anyway because you have no exception-handling facility.

        Lisp

        You shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds…

        BASIC

        Shoot yourself in the foot with a water pistol. On big systems, continue until entire lower body is waterlogged.

        APL

        You hear a gunshot and there’s a hole in your foot, but you don’t remember enough linear algebra to understand what happened.

        Prolog

        You attempt to shoot yourself in the foot, but the bullet, failing to find its mark, backtracks to the gun, which then explodes in your face.

        or

        No.

        PL/I

        You consume all available system resources, including all the offline bullets. The Data Processing & Payroll Department doubles its size, triples its budget, acquires four new mainframes and drops the original one on your foot.

        Postscript

        It takes the bullet ten minutes to travel from the gun to your foot, by which time you’re long since gone out to lunch. The text comes out great, though.

        Assembly Language

        You try to shoot yourself in the foot only to discover you must first reinvent the gun, the bullet, and your foot. It takes you three weeks to load the round and aim the gun. When you squeeze the trigger, the gun beeps several times, then crashes.

        Java

        The gun fires just fine, but your foot can’t figure out what the bullets are for and ignores them.

        PHP

        You shoot yourself in the foot with a gun made with pieces from 300 other guns.

        Perl

        You shoot yourself in the foot, but nobody can understand how you did it. Six months later, neither can you.

        Javascript

        You’ve perfected a robust, rich user experience for shooting yourself in the foot. You then find that bullets are disabled on your gun.

        1. DHCP and PXE and TFTP and HTTP in CentOS 6

          So I wanted to be able to configure “static” IP addresses for all the computers in our network, plus give out IP addresses within a range for guest machines. I needed DHCP (Dynamic Host Configuration Protocol) for that.

          I also wanted to be able to boot a machine off the network and install Linux on it without having to connect an optical drive. That’s what PXE (Preboot Execution Environment) is for. Together with Kickstart, I can automatically setup a Linux web server, workstation, etc. without even touching the keyboard (not really).

          TFTP (Trivial File Transfer Protocol) and HTTP are simply the protocols used together with PXE to transfer some files to get a machine to boot off the network.

          Anyway, let’s get started.

          DHCP

          So first thing is to install dhcp:

          yum install dhcp
          

          The configuration files for DHCP go in the /etc/dhcp/ directory. Since I only need ipv4, I’ll only be configuring dhcpd.conf and not dhcpd6.conf. Anyway, there’s a bunch of templates in /usr/share/doc/dhcp-x.x.x/ if you want. My configuration is below:

          authoritative;
          
          subnet 10.0.0.0 netmask 255.255.255.0 {
              range dynamic-bootp     10.0.0.240 10.0.0.250;
          
              option domain-name      "i4asiacorp.lan";
              option domain-name-servers  10.0.0.2, 10.0.0.3;
          
              option routers          10.0.0.1;
          
              default-lease-time      7200;
              max-lease-time          14400;
          }
          

          You always need the “authoritative;” option.

          So I setup a “subnet” section, but I believe if you only have one network, you can put all these options in the “root” of the configuration file.

          The “range” option is whatever IP addresses you want to provide to your network. The “dynamic-bootp” option in the range simply says that this range is also to be used for booting up network devices that support the protocol. Most machines these days do.

          “option domain-name” is simply the local domain. My company only has a local private network, so I like to use .lan for that. I don’t really want to mix it up with our website at i4asiacorp.com.

          “option domain-name-servers” is the DNS servers you will be using. Our network has two separate servers for this. If you just want to provide Internet access, perhaps setting it up to use something like Google’s DNS (8.8.8.8, 8.8.4.4) or OpenDNS (208.67.222.222, 208.67.220.220) will do.

          “option ruters” is whatever is your gateway to the Internet.

          “default-lease-time” is how long to provide the lease if the client doesn’t specify an expiration and “max-lease-time” is the maximum lease time ever. So for me, that’s 2 and 4 hours respectively. I could probably optimize that.

          After you set the proper IP addresses for your network, restart dhcpd and set it to start on server boot up:

          service dhcpd restart && chkconfig dhcpd on
          
          What about static IP addresses?

          So I mentioned I like setting up “static” IP addresses for the computers on our network. Why? Well, I like to make sure I know what machine is accessing what. But I also don’t want to manually configure everything. So I use DHCP for this.

          So how do you do this? Well, first thing you need is the MAC Address of the network device. You can get this in Linux or Mac by running the command:

          ifconfig
          

          and in Windows by:

          ipconfig /all
          

          It should look something like aa:bb:cc:dd:ee:ff. So now that you have it, you need to know what IP address you will be providing it. Then you’ll simply add that configuration to the end of dhcpd.conf. So, if you want to provide the machine with MAC Address aa:bb:cc:dd:ee:ff with IP address 10.0.0.123, you add the following configuration:

          host 123 {
              hardware ethernet aa:bb:cc:dd:ee:ff; fixed-address 10.0.0.123; }
          

          For the “host 123” the “123” part is simply whatever you want to call the section. For our internal setup, I use the name of the user. So if we had a user Michael, then I set the option up as “host michael”.

          Then remember to restart dhcpd: service dhcpd restart

          PXE and TFTP and HTTP

          Umm, I think I’ll do the PXE stuff in another post to keep things short. Sorry about that. I have a tendency to ramble.

          1. Source: walkthesky13

            G.O.A.T

            1. Source: sentimentoedor

              @mole_a This is too cool! :)

              1. Source: chinatowndo
                Play

                Yo-Yo Ma and Lil Buck. Beautiful.

                1. jimchuchu:

                  Hollywood (honestly). :) (via Viktor Hertz)

                  1. Source: mutuamatheka.wordpress.com
                    Camera Nikon D40
                    ISO 200
                    Aperture f/4.8
                    Exposure 1/60th
                    Focal Length 38mm

                    @Thogii at oneTouch Live ‘Hell’s gate’ Edition

                    1. Source: shamama
                      Loading more posts...