• Mac OS X,  Mac OS X Server,  Ubuntu,  Unix

    Separate commands on one line in Bash

    In bash, you can run multiple commands in a single line of a script. You do so by separating them with a semi-colon (;). The great thing about this is that if you end up using a variable, you can pass it on to subsequent commands. Here, we’re going to string three commands together and then echo the output: a=1;b=2;c=$a+$b;echo $c because we told c to be $a + $b, the $a expands to 1 and the $b expands to 2, we throw them together and then echo out the contents of c$ which appears as follows: 1+2 Now, we could have this thing do math as well, by wrapping…

  • Mac OS X,  Ubuntu,  Unix,  WordPress

    Resolve InnoDB Errors In MySQL

    Database won’t start? InnoDB errors are a pain. Where was krypted for a month? Did everything finally get to me and I gave up blogging? No, the site ended up having some problems with corruption in some rows of the InnoDB tables. But, I was able to get the site back up by putting the database into recovery mode. How did I do this? It’s pretty straight forward. Open my.cnf and paste these lines in there: innodb_force_recovery=3 innodb_purge_threads=0 Once the corruption is resolved, bring up empty databases and import your mysqldump into the new databases and link your site back up. But, the InnoDB force recovery puts the database into…

  • Mac OS X,  Programming,  Unix

    Mac DevOps Conference

    There’s another new conference in town! Well, not my town, but Vancouver. MacDev Ops is a hot topic. One that will only increase in the coming years. Thanks to Mat X and Brian Warsing for bringing about a brilliant conference. The conference will be held on June 19, 2015 and is an easy $99 if you sign up soon. Also, submit a talk if DevOps is your thing. They’re looking to bring the following topics to the table: Puppet, Chef and other automation from Desktop to Cloud and back Software deployment with Munki and AutoPkg: the app ecosystem surrounding it Cool tools: demo of awesome Mac Admin projects from GitHub DevOps: How…

  • Ubuntu,  Unix

    See Version Information In Linux

    There are a number of ways to see information about what version of Linux that you’re running on different cat /etc/lsb-release Which returns the distribution information, parsed as follows: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04.5 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION="Ubuntu Precise Pangolin (LTS)" LSB_release can also be run as a command, as follows: lsb_release -a Which returns the following: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu Precise Pangolin (LTS) Release: 12.04.5 Codename: precise lab_release can be used as a command as well: cat /etc/issue.net Which returns: Ubuntu Precise Pangolin (development branch) In Debian, you can simply look at the version file: cat /etc/debian_version Which returns the following: wheezy/sid Or Red Hat Enterprise can also…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Ubuntu,  Unix,  WordPress

    Install Pow for Rails Testing On OS X

    Pow is a Rack server for OS X. It’s quick and easy to use and lets you skip that whole update an Apache file, then edit /etc/hosts, ethane move a file, then run an app type of process. To get started with Pow, curl it down and pipe it to a shell, then provide the password when prompted to do so: odr:~ charlesedge$ curl get.pow.cx | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9039 100 9039 0 0 10995 0 --:--:-- --:--:-- --:--:-- 10996 *** Installing Pow 0.5.0... *** Installing local configuration files... /Users/charlesedge/Library/LaunchAgents/cx.pow.powd.plist *** Installing system…

  • Ubuntu,  Unix

    Linux and Free Memory Space

    The free command in Linux is used to show memory utilization. When run without any options, you can see the used and available space of swap and physical memory. By default, the option is displayed in kilobytes but when run with a -b option it is shown in bytes or -m will show in megabytes or -g in gigabytes or -t in terabytes. So to see the free space in bytes run the following: free -b The -o option shows the output adjusted for the buffer. The -t option also adds a total column as well as a line for total that shows swap and physical, combined. The -s will update…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Network Infrastructure,  Programming,  Ubuntu,  Unix

    Opposite Day: Reversing Lines In Files

    The other day, my daughter said “it’s opposite day” when it was time to do a little homework, trying to get out of it! Which reminded me of a funny little command line tool called rev. Rev reads a file and reverses all the lines. So let’s touch a file called rev ~/Desktop/revtest and then populate it with the following lines: 123 321 123 Now run rev followed by the file name: rev ~/Desktop/revtest Now cat it: cat !$ Now rev it again: rev !$ You go go forward and back at will for fun, much more fun than homework… Enjoy!

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Network Infrastructure,  sites,  Ubuntu,  Unix

    Manage Apex Domains In OS X

    OS X Server supports running a traditional bind implementation of DNS. You can define a record for most any name, including google.com, www.google.com, www.www.google.com, etc. You can use this to redirect subdomains. In this example, we’ll create an A Record to point www.google.com to 127.0.0.1 without breaking other google.com subdomains. To get started, let’s use the DNS service in the Server app to create test.www.google.com. The reason for this is that OS X will then create a zone file for www.google.com. If we created www.google.com instead, then OS X would automatically create google.com, which would break the other subdomains. To do so, open Server app and click on the DNS Service. Then…

  • Ubuntu,  Unix

    Installing the Docker for OpenStack Heat

    Docker is an engine that automates deploying applications as highly portable, self-sufficient containers, independent of hardware, language, framework, packaging system and hosting provider. Heat is the main project used when it comes to OpenStack orchestration. There is a Docker plugin for Heat. To install this plugin, you’ll need to use the stable/icehouse branch (which seems like what’s made the tool so mature rather than simply being available for Nova) to install Heat via apt-get install. Once downloaded, extract the contrib/docker folder and delete the tests directory. Then copy the contrib/docker folder to the OpenStack controller. Here we’ll put it at /usr/lib/heat directory. This results in the path of /usr/lib/heat/docker/docker. Next, install python-pip:…