diff options
author | Aaron Ball <nullspoon@iohq.net> | 2015-06-01 21:53:17 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@iohq.net> | 2015-06-28 14:41:14 -0600 |
commit | 6d041cdc56d8551c57780f198f0f8b4a37665ae6 (patch) | |
tree | 446adf3c3d27af0966ff5600441620686792f8ab | |
parent | dc8f226be5aca4718ea5e5798aebd96e88a8898f (diff) | |
download | oper.io-6d041cdc56d8551c57780f198f0f8b4a37665ae6.tar.gz oper.io-6d041cdc56d8551c57780f198f0f8b4a37665ae6.tar.xz |
Updated a few more posts
125 files changed, 5890 insertions, 0 deletions
diff --git a/html/files/01TeamExplorerTeamProjects.PNG b/html/files/01TeamExplorerTeamProjects.PNG Binary files differnew file mode 100755 index 0000000..7048b70 --- /dev/null +++ b/html/files/01TeamExplorerTeamProjects.PNG diff --git a/html/files/01_ClickSettings_-_X.jpg b/html/files/01_ClickSettings_-_X.jpg Binary files differnew file mode 100755 index 0000000..cb12063 --- /dev/null +++ b/html/files/01_ClickSettings_-_X.jpg diff --git a/html/files/01_SQL_Migration_ScriptDatabaseAs.png b/html/files/01_SQL_Migration_ScriptDatabaseAs.png Binary files differnew file mode 100755 index 0000000..40296cc --- /dev/null +++ b/html/files/01_SQL_Migration_ScriptDatabaseAs.png diff --git a/html/files/01_Welcome.jpg b/html/files/01_Welcome.jpg Binary files differnew file mode 100755 index 0000000..6f0375c --- /dev/null +++ b/html/files/01_Welcome.jpg diff --git a/html/files/02GroupMemberships.PNG b/html/files/02GroupMemberships.PNG Binary files differnew file mode 100755 index 0000000..69e5cab --- /dev/null +++ b/html/files/02GroupMemberships.PNG diff --git a/html/files/02_HardDiskMainSettings_-_X.jpg b/html/files/02_HardDiskMainSettings_-_X.jpg Binary files differnew file mode 100755 index 0000000..a888166 --- /dev/null +++ b/html/files/02_HardDiskMainSettings_-_X.jpg diff --git a/html/files/02_SQL_Select_Import_Data.png b/html/files/02_SQL_Select_Import_Data.png Binary files differnew file mode 100755 index 0000000..96e91c1 --- /dev/null +++ b/html/files/02_SQL_Select_Import_Data.png diff --git a/html/files/03SQLServerReportingServices.PNG b/html/files/03SQLServerReportingServices.PNG Binary files differnew file mode 100755 index 0000000..846e06a --- /dev/null +++ b/html/files/03SQLServerReportingServices.PNG diff --git a/html/files/03_Enter_Service_Account.jpg b/html/files/03_Enter_Service_Account.jpg Binary files differnew file mode 100755 index 0000000..6de8ba5 --- /dev/null +++ b/html/files/03_Enter_Service_Account.jpg diff --git a/html/files/03_SQL_Import_Choose_DataSource.png b/html/files/03_SQL_Import_Choose_DataSource.png Binary files differnew file mode 100755 index 0000000..1070873 --- /dev/null +++ b/html/files/03_SQL_Import_Choose_DataSource.png diff --git a/html/files/04CentralAdministration.PNG b/html/files/04CentralAdministration.PNG Binary files differnew file mode 100755 index 0000000..e766f8f --- /dev/null +++ b/html/files/04CentralAdministration.PNG diff --git a/html/files/04_HardDiskPreConvert_-_X.jpg b/html/files/04_HardDiskPreConvert_-_X.jpg Binary files differnew file mode 100755 index 0000000..5d122d1 --- /dev/null +++ b/html/files/04_HardDiskPreConvert_-_X.jpg diff --git a/html/files/04_Rediness_Checks_Successful.jpg b/html/files/04_Rediness_Checks_Successful.jpg Binary files differnew file mode 100755 index 0000000..ddf63f9 --- /dev/null +++ b/html/files/04_Rediness_Checks_Successful.jpg diff --git a/html/files/05_Applying_Configuration_Settings.jpg b/html/files/05_Applying_Configuration_Settings.jpg Binary files differnew file mode 100755 index 0000000..8bf623a --- /dev/null +++ b/html/files/05_Applying_Configuration_Settings.jpg diff --git a/html/files/06_Success.jpg b/html/files/06_Success.jpg Binary files differnew file mode 100755 index 0000000..ad9e172 --- /dev/null +++ b/html/files/06_Success.jpg diff --git a/html/files/07_HardDiskConverting_-_X.jpg b/html/files/07_HardDiskConverting_-_X.jpg Binary files differnew file mode 100755 index 0000000..519a2b9 --- /dev/null +++ b/html/files/07_HardDiskConverting_-_X.jpg diff --git a/html/files/A-hotmail01.jpg b/html/files/A-hotmail01.jpg Binary files differnew file mode 100755 index 0000000..6f10cf4 --- /dev/null +++ b/html/files/A-hotmail01.jpg diff --git a/html/files/A-hotmail02.jpg b/html/files/A-hotmail02.jpg Binary files differnew file mode 100755 index 0000000..0fa42e2 --- /dev/null +++ b/html/files/A-hotmail02.jpg diff --git a/html/files/Cell_comparison.ods b/html/files/Cell_comparison.ods Binary files differnew file mode 100644 index 0000000..2a76bb1 --- /dev/null +++ b/html/files/Cell_comparison.ods diff --git a/html/files/Cell_comparison.xlsx b/html/files/Cell_comparison.xlsx Binary files differnew file mode 100644 index 0000000..850a0ff --- /dev/null +++ b/html/files/Cell_comparison.xlsx diff --git a/html/files/IIS_01_Add_Role.jpg b/html/files/IIS_01_Add_Role.jpg Binary files differnew file mode 100755 index 0000000..71379fd --- /dev/null +++ b/html/files/IIS_01_Add_Role.jpg diff --git a/html/files/IIS_02_Role_Services.jpg b/html/files/IIS_02_Role_Services.jpg Binary files differnew file mode 100755 index 0000000..8ffd1eb --- /dev/null +++ b/html/files/IIS_02_Role_Services.jpg diff --git a/html/files/Img_2335_gsiii-no-glass-sm.jpg b/html/files/Img_2335_gsiii-no-glass-sm.jpg Binary files differnew file mode 100755 index 0000000..9d22252 --- /dev/null +++ b/html/files/Img_2335_gsiii-no-glass-sm.jpg diff --git a/html/files/Img_2337_gsiii-no-glass-dirty-sm.jpg b/html/files/Img_2337_gsiii-no-glass-dirty-sm.jpg Binary files differnew file mode 100755 index 0000000..93bb0ea --- /dev/null +++ b/html/files/Img_2337_gsiii-no-glass-dirty-sm.jpg diff --git a/html/files/Img_2338_gsiii-glass-pile-sm.jpg b/html/files/Img_2338_gsiii-glass-pile-sm.jpg Binary files differnew file mode 100755 index 0000000..747b3db --- /dev/null +++ b/html/files/Img_2338_gsiii-glass-pile-sm.jpg diff --git a/html/files/Img_2343_gsiii-no-glass-clean-sm.jpg b/html/files/Img_2343_gsiii-no-glass-clean-sm.jpg Binary files differnew file mode 100755 index 0000000..0e4c16f --- /dev/null +++ b/html/files/Img_2343_gsiii-no-glass-clean-sm.jpg diff --git a/html/files/Img_2344_gsiii-new-glass-sm.jpg b/html/files/Img_2344_gsiii-new-glass-sm.jpg Binary files differnew file mode 100755 index 0000000..b0d9a8a --- /dev/null +++ b/html/files/Img_2344_gsiii-new-glass-sm.jpg diff --git a/html/files/Img_2348_gsiii-new-glass-and-case-sm.jpg b/html/files/Img_2348_gsiii-new-glass-and-case-sm.jpg Binary files differnew file mode 100755 index 0000000..4a954ac --- /dev/null +++ b/html/files/Img_2348_gsiii-new-glass-and-case-sm.jpg diff --git a/html/files/ProPresenter-Multiselect_Move.png b/html/files/ProPresenter-Multiselect_Move.png Binary files differnew file mode 100755 index 0000000..734d3cc --- /dev/null +++ b/html/files/ProPresenter-Multiselect_Move.png diff --git a/html/files/ProPresenter-Slide_lock-locked.png b/html/files/ProPresenter-Slide_lock-locked.png Binary files differnew file mode 100755 index 0000000..99fc397 --- /dev/null +++ b/html/files/ProPresenter-Slide_lock-locked.png diff --git a/html/files/ProPresenter-Slide_lock-unlocked.png b/html/files/ProPresenter-Slide_lock-unlocked.png Binary files differnew file mode 100755 index 0000000..97f059c --- /dev/null +++ b/html/files/ProPresenter-Slide_lock-unlocked.png diff --git a/html/files/ProPresenter_Slide_Loops00.png b/html/files/ProPresenter_Slide_Loops00.png Binary files differnew file mode 100755 index 0000000..9503eed --- /dev/null +++ b/html/files/ProPresenter_Slide_Loops00.png diff --git a/html/files/ProPresenter_Slide_Loops01.png b/html/files/ProPresenter_Slide_Loops01.png Binary files differnew file mode 100755 index 0000000..de48ee9 --- /dev/null +++ b/html/files/ProPresenter_Slide_Loops01.png diff --git a/html/files/ProPresenter_Slide_Loops02.png b/html/files/ProPresenter_Slide_Loops02.png Binary files differnew file mode 100755 index 0000000..18fcf47 --- /dev/null +++ b/html/files/ProPresenter_Slide_Loops02.png diff --git a/html/files/ProPresenter_Slide_Loops03.png b/html/files/ProPresenter_Slide_Loops03.png Binary files differnew file mode 100755 index 0000000..27e5ad2 --- /dev/null +++ b/html/files/ProPresenter_Slide_Loops03.png diff --git a/html/files/ProPresenter_Slide_Loops04.png b/html/files/ProPresenter_Slide_Loops04.png Binary files differnew file mode 100755 index 0000000..d268944 --- /dev/null +++ b/html/files/ProPresenter_Slide_Loops04.png diff --git a/html/files/SQL_03_Instance_Configuration.jpg b/html/files/SQL_03_Instance_Configuration.jpg Binary files differnew file mode 100755 index 0000000..1895c94 --- /dev/null +++ b/html/files/SQL_03_Instance_Configuration.jpg diff --git a/html/files/Sansa-Fuze-MM-Playlist-Options.jpg b/html/files/Sansa-Fuze-MM-Playlist-Options.jpg Binary files differnew file mode 100755 index 0000000..af546a9 --- /dev/null +++ b/html/files/Sansa-Fuze-MM-Playlist-Options.jpg diff --git a/html/files/TFS_02_Features_to_Install.jpg b/html/files/TFS_02_Features_to_Install.jpg Binary files differnew file mode 100755 index 0000000..59ef5a3 --- /dev/null +++ b/html/files/TFS_02_Features_to_Install.jpg diff --git a/html/files/TFS_04_MidInstall_Restart.jpg b/html/files/TFS_04_MidInstall_Restart.jpg Binary files differnew file mode 100755 index 0000000..347aa42 --- /dev/null +++ b/html/files/TFS_04_MidInstall_Restart.jpg diff --git a/html/files/Toshiba_Canvio_Slim.png b/html/files/Toshiba_Canvio_Slim.png Binary files differnew file mode 100755 index 0000000..cd7faf7 --- /dev/null +++ b/html/files/Toshiba_Canvio_Slim.png diff --git a/html/files/WD_Elements.jpg b/html/files/WD_Elements.jpg Binary files differnew file mode 100755 index 0000000..d4b3c13 --- /dev/null +++ b/html/files/WD_Elements.jpg diff --git a/html/files/iohq-logo.png b/html/files/iohq-logo.png Binary files differnew file mode 100755 index 0000000..50863bf --- /dev/null +++ b/html/files/iohq-logo.png diff --git a/html/files/terminal001.png b/html/files/terminal001.png Binary files differnew file mode 100755 index 0000000..e3ccdef --- /dev/null +++ b/html/files/terminal001.png diff --git a/html/files/terminal002b.png b/html/files/terminal002b.png Binary files differnew file mode 100755 index 0000000..522235a --- /dev/null +++ b/html/files/terminal002b.png diff --git a/html/files/terminal003.png b/html/files/terminal003.png Binary files differnew file mode 100755 index 0000000..a42b4c5 --- /dev/null +++ b/html/files/terminal003.png diff --git a/html/files/terminal004.png b/html/files/terminal004.png Binary files differnew file mode 100755 index 0000000..96fc316 --- /dev/null +++ b/html/files/terminal004.png diff --git a/src/Android:Configuring_Hotmail_Exchange.ascii b/src/Android:Configuring_Hotmail_Exchange.ascii new file mode 100644 index 0000000..79170ba --- /dev/null +++ b/src/Android:Configuring_Hotmail_Exchange.ascii @@ -0,0 +1,88 @@ +Android:Configuring Hotmail Exchange +==================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +*EDIT:* I tested it for a day now and up to this point, email works great. I +got a contact to sync from my phone to my online address book as well. It did +however take almost a day for it to appear online. Also, a calendar entry made +on my phone synced in under a minute to the online calendar. The other way +around, a calendar entry made online synced to my phone in about two minutes. + +Yesterday (August 30) Microsoft released a new functionality for Windows Live +Hotmail that many have been waiting for for some time: Exchange capabilities. + +*If you want to skip all the background stuff, you may now head down the the +bolded section titled "Now let's get started...".* + +This year Microsoft has released a lot of new functionality for Hotmail that +has really changed its quality. With GMail being arguably the best web-based +email service, Hotmail has a lot of catching up to do. Thankfully, the first +thing Hotmail started with was allowing pop3 access for free. The next step to +compete with GMail was obviously free IMAP, which GMail released two years ago +I believe. Instead though, Microsoft gives us exchange for Hotmail. How cool is +that?! + +What's significant about exchange versus IMAP you ask? Well, exchange allows +for the synchronization of more than just mail, unlike IMAP. With exchange you +can sync your mail, your calendar, and your contacts. Not only does it +synchronize your mail though, it utilizes something called "push mail". This +means your phone doesn't check for updates ever five, ten,, or thirty minutes; +rather, the mail is "pushed" to your email client allowing for instantaneous +delivery. Cool, yeah? + +One thing before doing this though. + +.Obligatory Disclaimer +~~~~ +Microsoft has not officially said that this works with Android. Many people +have reported that it mostly works though. According to Microsoft, "Hotmail +team will add Android to list of supported devices in the coming months after +testing is completed." +~~~~ + + +[[now-lets-get-started]] +== Now, Let's Get Started + +First, launch your mail application called...you guessed it!..."Email" From +there, chances are your Accounts screen will come up. If this is the case, hit +the menu button on your phone and select "Add Account". + +____ +image:files/A-hotmail01.jpg[height=400] + +From there, type in your email address and password. In my case, this was +"username@live.com", though "username@hotmail.com" should have no problem as +well. Now, select "Manual Setup".,title="From there, type in your email address +and password. In my case, this was "username@live.com", though +"username@hotmail.com" should have no problem as well. Now, select "Manual +Setup". +____ + +At this point the application will ask you what kind of mail connection this +will be. You should see POP, IMAP, and Exchange. Select "Exchange". + +On the window you're taken to, most of the lines should be filled in for you. +We do have to make a few changes though. + +____ +image:files/A-hotmail02.jpg[height=400] + +First off, your "DomainUsername" will be slightly incorrect. What you probably +see is "username".,title="First off, your "DomainUsername" will be slightly +incorrect. What you probably see is "username". +____ + + +And that's it! + + +Category:Android +Category:Email + + +// vim: set syntax=asciidoc: diff --git a/src/Android_Client_and_Sync_with_ownCloud_on_NGINX.ascii b/src/Android_Client_and_Sync_with_ownCloud_on_NGINX.ascii new file mode 100644 index 0000000..359de3c --- /dev/null +++ b/src/Android_Client_and_Sync_with_ownCloud_on_NGINX.ascii @@ -0,0 +1,61 @@ +Android Client and Sync with OwnCloud on NGINX +============================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have been looking for a good way to move completely from Google for quite +some time. Many of the things I am dependant upon them for are pretty vital for +day to day operations. One of these is of course contact and calendar syncing. +Currently, my solution to that problem is http://www.egroupware.org[EGroupware] +for my server using syncml through http://funambol.com[Funambol] to synchronize +my contacts from my web server to my Android phone. This solution is bulky +taking about 80 MB on my server for the PHP code. Though this works, it is +hardly ideal. That's why I was so excited to try out +http://owncloud.org[ownCloud]. Their Android client is still definitely a work +in progress, but at least it's something (not to mention that they use +standards-based services, so several other sync apps for Android can work with +ownCloud). + +Now, I run http://nginx.org[NGINX] on my web server which does things a little +differently than Apache, especially in regards to .htaccess files. Despite that +though, out of the box (or tarball) ownCloud seems to work perfectly. However, +when you try to sync up your Android phone via +http://owncloud.org/support/android/[their dandy client], you get this obscure +error + +---- +Wrong path given +---- + +Additionally, when you check your server access logs, you'll see + +---- +Requested uri (/remote.php/webdav.php) is out of base uri (/remote.php/webdav/) +---- + +This is most likely because you need two location directives in your NGINX conf +file (or vhost file if you're doing things that way). To fix this just put the +following two things in your said config file (This assumes your own cloud +server is running at + +---- +location /owncloud { + index index.php; + try_files $uri $uri/ @owncloud +} +location @owncloud { + rewrite ^/owncloud/(.*)$ /owncloud.php/index.php?p=$1 last; +} +---- + +And that should do it for you! + + +Category:Nginx +Category:Android + + +// vim: set syntax=asciidoc: diff --git a/src/Apache:Listening_Port.ascii b/src/Apache:Listening_Port.ascii new file mode 100644 index 0000000..e7281f1 --- /dev/null +++ b/src/Apache:Listening_Port.ascii @@ -0,0 +1,60 @@ +Apache:Listening Port +======================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently had a web server behind a load balancer that needed to listen on a +different port because the load balancer was translating port 80 traffic for +security. Thankfully, changing the ports that HTTPd listens on is relatively +simple. + +Crack open your favorite command line editor. For the purposes of this example, +I'll be using vim. + +---- +vim /etc/httpd/conf/httpd.conf +---- + +This is a relatively large file, so you'll have to scroll for some time +to find what we're looking for. Otherwise, you can use search. Scroll +down until you find a section that looks like + +---- +# +# Listen: Allows you to bind Apache to specific IP addresses and/or +# ports, in addition to the default. See also the <VirtualHost> +# directive. +# +# Change this to Listen on specific IP addresses as shown below to +# prevent Apache from glomming onto all bound IP addresses (0.0.0.0) +# +# Listen 12.34.56.78:80 +# +Listen 80 +---- + +Depending on your needs, whatever ports you need, add "Listen <port>" in this +section. If for instance you need httpd to listen for an ssl (https) encrypted +connection, you can add + +---- +Listen 443 +---- + +Once you've made the changes you want, save and close the file and run the +command + +---- +/etc/init.d/httpd restart +---- + +That's all there is to it! Now for lunch. + + +Category:Apache + + +// vim: set syntax=asciidoc: diff --git a/src/Attached_Devices_and_VPS_(OpenVZ_and_Virtuozzo).ascii b/src/Attached_Devices_and_VPS_(OpenVZ_and_Virtuozzo).ascii new file mode 100644 index 0000000..93c668d --- /dev/null +++ b/src/Attached_Devices_and_VPS_(OpenVZ_and_Virtuozzo).ascii @@ -0,0 +1,21 @@ +Attached Devices and VPS (OpenVZ and Virtuozzo) +=============================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +*Note to self:* When hosting on a VPS using OpenVZ or Virtuozzo, to list +attached devices and their mount points, "fdisk -l" doesn't work ("cannot open +/proc/partitions") and "/proc/partitions" doesn't exist. To list all mount +points, run *df -h* : lists all drives and their free space + +/etc/fstab still works as it should. + + +Category:Linux +Category:Virtualization + + +// vim: set syntax=asciidoc: diff --git a/src/Benchmarks:Toshiba_Canvio_Slim.ascii b/src/Benchmarks:Toshiba_Canvio_Slim.ascii new file mode 100644 index 0000000..0e4f877 --- /dev/null +++ b/src/Benchmarks:Toshiba_Canvio_Slim.ascii @@ -0,0 +1,60 @@ +Benchmarks:Toshiba Canvio Slim +============================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +If you're considering purchasing an external hard drive, :Category:Benchmarks[ +these benchmarks] should hopefully help clear up some questions you might have. +In this post, I benchmark my http://www.toshiba.com/us/canvio-slim[Toshiba +Canvio Slim] hard drive. I've been using this drive for about a year now and +it has performed well for me. It has even taken a drop while it was plugged in +(it disconnected from the cable even). Here are the IO metrics from the great +https://www.gnu.org/[GNU] utility, dd + +image:Toshiba_Canvio_Slim.png[height=300] + +* *Manufacturer*: http://www.toshiba.com/us/[Toshiba] +* *Name*: http://www.toshiba.com/us/canvio-slim[Canvio Slim] +* *Made in*: Philippines +* *Size*: 500GB +* *Interface*: USB 3.0/2.0 +* *Average Write Speed*: 99.0 MB/s +* *Average Read Speed*: 93.5 MB/s + +[[benchmarks]] +=== Benchmarks + +[[usb3-devzero-write]] +==== USB3 /dev/zero Write + +Writing 16 gigabytes of zeros. + +---- +dd if=/dev/zero of=/dev/sdc bs=1M count=16384 +16384+0 records in +16384+0 records out +17179869184 bytes (17 GB) copied, 173.495 s, 99.0 MB/s +---- + + +[[usb3-read-to-devnull]] +==== USB3 Read to /dev/null + +Reading 16 gigabytes to /dev/null. + +---- +dd if=/dev/sdc of=/dev/null bs=1M count=16384 +16384+0 records in +16384+0 records out +17179869184 bytes (17 GB) copied, 183.838 s, 93.5 MB/s +---- + +Category:Hard_Drives +Category:Benchmarks +Category:Toshiba + + +// vim: set syntax=asciidoc: diff --git a/src/Benchmarks:WD_Elements.ascii b/src/Benchmarks:WD_Elements.ascii new file mode 100644 index 0000000..ac3b128 --- /dev/null +++ b/src/Benchmarks:WD_Elements.ascii @@ -0,0 +1,115 @@ +Benchmarks:WD Elements +====================== +:author: Aaron Ball +:email: nullspoon@iohq.net + +== Benchmarks:WD Elements + +For my work computer, I installed https://archlinux.org[Arch Linux] on an +external USB hard drive. My idea behind that is that if I'm ever working from +home and forget to bring my charger with me, I can just plug the drive into +another computer and I'm back up and running. So far it's worked great. A few +months back though, I dropped the drive while it was running and while it was +surprisingly okay (despite being read-only until reboot), it was a bit slower. +I would assume a head crash, but thus far I have noticed no data corruption. + +All that said, I want to get another drive that I can mirror with (software +raid 1 anybody?), just in case something happens. I've been hunting around +online for the last few days and have found it to be impressively difficult to +find real specs on external USB hard drives. Sure, you can get that it's USB3 +and maybe even its rpm, but you're almost guaranteed not to find cache size or +even what drive is inside the enclosure, metrics I consider to be very +important. That's why I've decided to post the IO metrics for this drive. +Hopefully someone will find these metrics useful. + +image:files/WD_Elements.jpg[height=300] + +* *Manufacturer*: http://www.wdc.com/en/[Western Digital] +* *Name*: Elements +* *Made in*: Malaysia +* *Size*: 1TB +* *Interface*: USB 3.0/2.0 +* *Average Write Speed*: 104 MB/s +* *Average Read Speed*: 107 MB/s + + +[[benchmarks]] +=== Benchmarks + +[[usb3-devzero-write]] +==== USB3 /dev/zero Write + +The fastest place I can think of to get data from and avoid any bottlenecks +outside of the drive is to write from /dev/zero. The amount of processing power +that goes into writing all zeros __is insignificant next to the power of the +force__...er...reading data from another drive, potentially introducing more +bottlenecks and not getting good measurements. Let us begin... + +---- +dd if=/dev/zero of=/dev/sdc bs=1M count=8192 +8191+1 records in +8191+1 records out +8589131776 bytes (8.6 GB) copied, 82.9999 s, 103 MB/s +---- + +Double the amount of data being written... + +---- +dd if=/dev/zero of=/dev/sdc bs=1M count=16384 +16384+0 records in +16384+0 records out +17179869184 bytes (17 GB) copied, 161.13 s, 107 MB/s +---- + +Looks like overall this drive consistently averages just over 100 MB/s plugged +in to USB3. + + +[[usb3-read-to-devnull]] +==== USB3 Read to /dev/null + +Here we're basically doing the same as writing from /dev/zero, but instead +we're reading verbatim the first _x_ consecutive number of bytes and sending +them to a device that literally can't be a bottleneck: /dev/null. It's like +sending dead satellites floating into space +(https://www.youtube.com/watch?v=rWVGupqvCL8[spaaaaacce]) instead of spending +the time to land them (if they don't burn up) and disassembling. If I had to +pick somewhere to send something fast where there wouldn't be any bottlenecks, +the vast void of space is where I'd send it - that is equivelant to /dev/null. +Not a great analogy, I know, but honestly, I just wanted to reference +https://www.youtube.com/watch?v=rWVGupqvCL8[that Portal] video. + +---- +dd if=/dev/sdc of=/dev/null bs=1M count=8192 +8192+0 records in +8192+0 records out +8589934592 bytes (8.6 GB) copied, 80.5907 s, 107 MB/s +---- + + +[[conclusion]] +=== Conclusion + +* **Average write speed**: 104 MBps (832 Mbps = .832 Gbps) +* **Average read speed**: 107 MBps (856 Mbps = .856 Gbps) + +Overall I'd say this drive is okay. As mentioned, the maximum speed of the +https://en.wikipedia.org/wiki/USB_3.0[USB3 spec] is 5 Gbps and this is getting +just shy of 1/5 that. I won't balk at that because a 100 megabytes per second +transfer rate is still pretty impressive for an external hard drive (that's +838,860,800 bits per second!). + +One final thing to note, I ran these benchmarks on two systems, my laptop and +my server, to make sure the USB3 port, processor, bus, etc. weren't themselves +bottlenecks. The transfer rates were nearly identical (insignificantly +different). + + +Category:Western_Digital + +Category:Hard_Drives + +Category:Benchmarks + + +// vim: set syntax=asciidoc: diff --git a/src/Btrfs:RAID_Setup.ascii b/src/Btrfs:RAID_Setup.ascii new file mode 100644 index 0000000..624fafa --- /dev/null +++ b/src/Btrfs:RAID_Setup.ascii @@ -0,0 +1,165 @@ +Btrfs:RAID Setup +================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctype} + +I recently became very interested in +http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29[LVM] and its +ability to have a volume that spans multiple drives. I was just about to do an +LVM setup when I began researching +https://btrfs.wiki.kernel.org/index.php/Main_Page[btrfs] in more depth. It is +rumored to be the next replacement for +https://ext4.wiki.kernel.org/index.php/Main_Page[ext4], the default Linux +filesystem (in most cases). It also happpens to support volumes that span +multiple devices (http://en.wikipedia.org/wiki/Standard_RAID_levels[raid], +though software raid albeit), aside from a whole +https://btrfs.wiki.kernel.org/index.php/Main_Page#Features[list] of other +functionalities. + +Being a person who really enjoys trying new, cool, and often unstable things +(who doesn't love a good learning experience), I decided to set up a +http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5[raid 5] using btrfs +with three whopping one terabyte drives. If all goes well, I should be able to +loose one drive and still have 2 terabytes ( [3-1]*1000 = 2000 ) fully +functional. + + +[[getting-started]] +== Getting Started + +Creating a btrfs filesystem is as simple as creating an ext4 filesystem (or any +other filesystem for that matter). You use the mkfs command. However, I +created a raid setup, so I needed a few more parameters. Here's what I used. + +---- +mkfs.btrfs -m raid5 -d raid5 /dev/sdb /dev/sdc /dev/sdd +---- + +Well that was easy. What'd we just do? + +[cols=",",options="header",] +|================================================================ +|mkfs.btrfs |duh +|-m raid5 |Sets the metadata up to use raid 5 +|-d raid5 |Set the data up to use raid 5 +|/dev/sdb /dev/sdc /dev/sdd |Span our volume across these devices +|================================================================ + +With that, you should now [very quickly] have a new raid 5 (or whatever you +selected for your raid levels). To mount it, run the mount command on any of +the raw devices in your raid. + +---- +mount -t btrfs /dev/sdb /mnt/oh_heyyy +---- + + +[[compression]] +== Compression + +Btrfs supports various kinds of seamless compression. The default is none since +compression will cause a performance hit (naturally). I thought I'd give it a +try anyways. I set up lzo compression (supposedly the fastest compression, but +less effective) about half way through my sync job (forgot to do it initially). +The original total size of the files in each home directory came to 386 GB +(lots of users for a home system). The end result after compression was 377 GB, +so I ended up saving 9 GB of space while still getting an amazing transfer rate +(see the link:#Benchmarks[ benchmarks] section). Keep in mind though that I +enabled compression after I had already synced a good 100 GB of files, so there +is a good portion of that data that isn't compressed. Despite that though, 9 GB +of space isn't too bad, especially given the performance. + + +[[handy-commands]] +== Handy Commands + +Here's what commands I'm using most frequently up to this point. + +* **btrfs fi**[lesystem] **show**: Shows a list of filesystems and their +corresponding devices. +* **btrfs fi**[lesystem] **label <dev> <label>**: Changes the label of +the specified raid device. +* **btrfs fi**[lesystem] **df /path/to/mount**: Displays real df data +about the mounted volume. + + +[[benchmarks]] +== Benchmarks + +I know there are other ways to benchmark storage io, but I wanted to see what +the maximum write speed would be and I don't have a second raid set up to get a +high transfer rate in, so my fastest option at this point is /dev/zero. Here's +my setup (again). + +* My btrfs raid 5 is mounted at /home/. The raid is made up of three 1 +TB Western Digital Green drives, each at 7200 rpm and it is mounted with "-o +compress=lzo". +* The OS itself ( / ) is installed on a single HDD, a 7200 rpm 500 GB +Maxtor (slightly olde). + +[[btrfs-raid-performance]] +=== Btrfs Raid Performance + +First, we test writing 2000 1M blocks of zeros to /home/, the raid. + +---- +[root@zion ~]# dd if=/dev/zero of=/home/bench.test bs=1M count=2000 +2000+0 records in 2000+0 records out 2097152000 bytes (2.1 +GB) copied, 6.24284 s, 336 MB/s +---- + +336 MB/s! Not bad for a homemade drive array using software raid and +some desktop drives. + + +[[non-raid-single-hdd-performance]] +=== Non-Raid Single HDD Performance + +Starting with the same as the last but writing to /root/, the single HDD, we +get... + +---- +[root@zion ~]# dd if=/dev/zero of=/root/bench.test bs=1M count=2000 +2000+0 records in 2000+0 records out 2097152000 bytes +(2.1 GB) copied, 30.5043 s, 68.7 MB/s +---- + + +[[impressions]] +== Impressions + +I might not be well versed enough in the area of storage, but setting up a +btrfs raid was really easy. I did have to learn all the different raid levels +to decide which I wanted to use of course, but I would have done that anyways. +The filesystem (again, spanning 3 TB) was created ridiculously fast (as fast as +I hit the enter key). I performed an rsync from my old drive (a single 500 GB +HDD, 7200 rpm, 3 Gbit/s) to the new raid (2 TB across 3 HDDs, 7200 rpm, 6 +Gbit/s) volume and got about a 31 MB per second transfer rate, which is the max +transfer rate that my single 500 GB drive has ever done anyways, so at least +btrfs can perform that well (not that that's particularly amazing). I was also +very impressed by the 336 MB/s write speed of the raid array. Perhaps I'm +ignorant at this point in time, but that seems pretty impressive for some cheap +off-the-shelf desktop drives. They're not even 10k rpm, let alone 15k. I would +certainly say that from a performance perspective, btrfs is definitely ready +for home use. It may be a little new for enterprise use, but that's up to the +enterprise. For me though, I will keep using it until I see any problems. Even +then, I'll still troubleshoot and then probably continue using it. + +Finally, I have to give some serious credit to the guys who wrote the b-tree +filesystem (oddly Oracle sponsored it). It's this kind of open source that +drives the world of technology (not that others don't of course) to expand +beyond "what the consumer wants". You guys are innovating in the coolest ways +and best of all, you're making it freely available. Many thanks guys! + + + +Category:Linux +Category:Btrfs +Category:Storage +Category:RAID + + +// vim: set syntax=asciidoc: diff --git a/src/Cell_Provider_Comparison.ascii b/src/Cell_Provider_Comparison.ascii new file mode 100644 index 0000000..28e1ad9 --- /dev/null +++ b/src/Cell_Provider_Comparison.ascii @@ -0,0 +1,44 @@ +Cell Provider Comparison +======================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +A few years ago, I was researching cell phone providers, and noticed a distinct +lack of _real_ information for an accurate comparison. It seems that everyone's +monthly rates are comprised of different numbers; they charge up front for the +phones, or they don't, or they kind of do; all of the devices cost different +amounts between the different providers; etc. The only real number that was of +any use, was calculating the total 24 month cost (the duration of a contract, +whether they say they have them or not), since in the end that's what really +mattered. Consequently, I decided to build myself a spreadsheet containing all +of this information in an attempt to gather it all in one useful place. + +[[a-few-preliminary-notes]] +A few Preliminary Notes +~~~~~~~~~~~~~~~~~~~~~~~ + +* The information in this spreadsheet _should_ be accurate as of + **2014.12.22**. + +* The T-Mobile "Monthly Cost (no phone)" cell is accurate up to three + phones because I haven't written the logic into the cell to handle more than + that. + +* Each cell who's value isn't immediately obvious most likely has a + comment. Please hover over the cell to see each comment for more information. + +* Each of the values that has something to do with a phone compares the + LG G3 where possible for as accurate a comparison as possible. + +[[the-files]] +The Files +~~~~~~~~~ + +* For *OpenOffice/LibreOffice* users: link:files/Cell_comparison.ods[Cell_comparison.ods] +* For *Microsoft Office* users: link:files/Cell_comparison.xlsx[Cell_comparison.xls] + + +// vim: set syntax=asciidoc: diff --git a/src/Changing_the_Hostname_on_a_Linux_Box.ascii b/src/Changing_the_Hostname_on_a_Linux_Box.ascii new file mode 100644 index 0000000..7ea649a --- /dev/null +++ b/src/Changing_the_Hostname_on_a_Linux_Box.ascii @@ -0,0 +1,58 @@ +Changing the Hostname on a Linux Box +==================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently had need to change a server name due to a change in our server +naming scheme (local ski resorts to breweries). For the simple comedy of the +naming scheme switch, here's how it currently looks (without server prefixes +for security purposes of course). If you just want the solution, skip down a +paragraph. + +Our current environment is mostly virtualized. The hosts are named after +breweries and their virtual guests are named after the beers that each brewery +produces. Clever, yeah? I can already feel my morale rising. + + + +First off, open up a terminal window + +image:files/terminal001.png[height=400] + +Then type + +image:files/terminal002b.png[height=200] + +The file that comes up should contain nothing but a hostname. In my case this +is . (Ctrl + x closes the file, y says to save the file before closing, Enter +saves the file under the original filename). + +image:files/terminal003.png[height=300] + +Once you've done this, all you need to do is restart your computer and you +should be golden. + +Here's how we fix the aforementioned issue. + +If you've closed your terminal for the restart, open it up again. Type *sudo +nano /etc/hosts* + +image:files/terminal004.png[height=300] + +At the top you should see 127.0.0.1, 127.0.1.1 and their associated +'hostnames'. The one to the right of 127.0.1.1 should show your old hostname. +Change that to the new hostname and save the file (Press Ctrl + x -> y -> +Enter). Now your computer's IP address should resolve to its new hostname. + +Enjoy! + +Now for a cup of joe... + + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Church_Media_Computer_Setup.ascii b/src/Church_Media_Computer_Setup.ascii new file mode 100644 index 0000000..8f2c99f --- /dev/null +++ b/src/Church_Media_Computer_Setup.ascii @@ -0,0 +1,108 @@ +Church Media Computer Setup +=========================== + +My church recently got a new media computer. We don't really have a defined +process for setting one up and I haven't really seen any recommendations on the +interwebs, so here I am documenting all the things that I have learned to do +throughout my time of running media and now also use. Some of these things may +seem a little strict, so please take what you consider to be the meat and spit +out what you consider to be the bones. + +[[desktop]] +== Desktop + +[[desktop-background]] +=== Desktop Background + +Make sure the desktop background is set to solid black. This is in case the +media software crashes or you need to transition from something like your media +software to powerpoint or vlc (assuming your media software doesn't support +playing those in-house). With this, you can fade to black, minimize/close, and +launch your next program with nothing but a nice smooth fade to black and back. + + +[[system-sounds]] +=== System Sounds + +Next up, be sure to turn off all system sounds. My church plays its music +before and after service from the media computer (who's doesn't?) and system +sounds are pretty intrusive in the middle of some Mumford and Sons. + +[[users]] +=== Users + +This is something that has a lot of differing opinions. _In my opinion_, there +should be a media account and an administrator account. If you church has the +resources to have a dedicated media computer not used for anything else, it +should, unless of course that is deemed not being a good steward of resources +(it does after all stay turned off nearly all week... I'm on the fence about +this one). Nevertheless though, it is typically considered a best practice to +have your users be users instead of administrators. Otherwise, you'll likely +end up with every browser and music player imaginable installed, possibly along +with some viruses as well. I once cleaned up a media computer that had Virtual +Box installed on it with an Ubuntu virtual machine set up. It was an experiment +no one ever bothered to clean up and it booted with the system, taking up lots +of cpu time, memory, and storage (40G). + +Having your user types be seperate also helps with clutter. Photo editing +usually doesn't require access to the Sunday service video backgrounds, song +texts, etc. Likewise, your Sunday media folks don't need to see the unrelated +clutter created by editing photos. + + +[[media-software]] +== Media Software + +[[all-in-one-place]] +=== All in One Place + +It's generally best to consolidate all of your media resources into one place. +This might include announcement videos, countdown videos, background videos and +images, etc. Be sure all of your people running the media computer know where +this is so they know where to look and they know where to put new files. On +Windows, I typically have a setup within the User's directory that looks +somewhat like + +*C:\Users\Media\Media* (Yep, there's two so we can have seperate documents, +downloads, etc) + +* *Pictures* +** Foregrounds +*** Announcements (this one might contain dated sub-directories so you can + track what was used and when) +** Backgrounds +* *Videos* +** Foregrounds +*** Announcements (this one might contain dated sub-directories so you can + track what was used and when) +** Backgrounds +* *Bibles* (in case your media software needs a place to store this) + + +[[image-and-video-formatting]] +=== Image and Video Formatting + +Make sure your default settings are in place for aspect ratios of imported +files. Most of the time, you want to your backgrounds to __scale to fill__, not +fit, as sometimes your text runs right up against one of the slide borders. +Videos you typically want to _scale to fit_ since they can often have things +you want to focus on on the sides and you don't want that cut off. + + +[[fonts]] +=== Fonts + +If your media software supports it, set the default font sizes, alignment, and +other styles for songs, announcements, Bible excerpts, etc. While adjusting +these per song may not be difficult, it adds more time to creating a +presentation. Occasionally there are oversights and songs, Bible verses, or +anouncements are missed and need to be added on the fly. Having a "sane +default" means you can add something and it will at the very least not have +text spilling off the sides, a font far too large, or any number of other +things. + + +Category:Drafts + + +// vim: set syntax=asciidoc: diff --git a/src/Command_Line_Auto-Complete.ascii b/src/Command_Line_Auto-Complete.ascii new file mode 100644 index 0000000..49476a3 --- /dev/null +++ b/src/Command_Line_Auto-Complete.ascii @@ -0,0 +1,52 @@ +Command Line Autocomplete +========================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I was working with a fellow aspiring Linux user today on a project with him +(yes, I'm talking about you Eric) and I noticed that when he would 'cd', he +would completely type the folder name, even when it was apache-tomcat-6.0.26. +If you've been using Linux for any amount of time, this might give you a +headache because you know about Bash's autocomplete feature. I mentioned it to +him and after seeing what it did, he exclaimed that he had been looking all +over for that and was never able to find it. + +Note that this little trick works on windows command line as well as linux/unix +command line (most shells support some variant of this - bash, zsh, ksh). While +the two categories behave slightly differently, it still provides a +functionality that is comparable to that of a breath of fresh air in a sewage +treatment plant. + +For those of you who are impatient, **the auto-complete feature of bash is +executed with the <tab> key**. + +How is it used? We'll use linux for this example. + +If you type ... + +---- +cd /usr/li <tab> +---- + +...the shell will fill in /usr/lib. Now, you will notice that there are two +directories in the /usr/ directory that start with lib. If you then proceed to +type... + +---- +cd /usr/libe <tab> +---- + +...the shell will fill in /usr/libexec. + +Neat, huh? + + + +Category:Linux +Category:Bash + + +// vim: set syntax=asciidoc: diff --git a/src/Comparing_Remote_Files_Without_Breaking_a_Sweat.ascii b/src/Comparing_Remote_Files_Without_Breaking_a_Sweat.ascii new file mode 100644 index 0000000..54110ca --- /dev/null +++ b/src/Comparing_Remote_Files_Without_Breaking_a_Sweat.ascii @@ -0,0 +1,57 @@ +Comparing Remote Files without Breaking a Sweat +=============================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Today I needed to compare a relatively large list of remote files to a local +copy. Yep, you guessed it... it's auditing time again! + +Here's what my setup looks like. + +From various other commands (lots of pipes), I parsed my kludgy list of server +metadata down to a list of servers that I needed to check. On that note, +despite the really terrible methods we're using to track this kind of +information, I really do enjoy the challenge of having to write a bash or perl +one liner to parse the output of some badly formatted unknown space quantity +delimited data whose case is most likely wrong, trimming multiple spaces, +fixing the case, grabbing the columns I need, and redirecting to a file for +later use. My thanks to the folks a la GNU for cat, tr, cut, grep, and still +again tr. + +Anyways, back to the topic at hand. We now have a list of server hostnames, one +per line. As they say, "Hey guys, watch this!" + +---- +for s in `cat list.txt`; do echo -e "\n\n### $s" >> diff.txt; diff <( ssh root@$s cat /etc/sudoers ) sudoers >> diff.txt; done +---- + +So what have we here? + +Firstly, we start up a bash for loop. This will make $s equal to the +name of each of the servers as we loop to them. + +Now, inside of the loop we first echo the server's name ( $s ) so we've +got a marker to tell us which diff we're looking at. After that, the fun +happens. + +---- +diff <( ssh root@$s cat /etc/sudoers ) sudoers >> diff.txt +---- + +Here, we are running the diff command to diff the remote file ( +<( ssh root@$s +cat /etc/sudoers )+ ) with the local file ( sudoers ), and we are redirecting +the output to diff.txt. What's neat about this (I think it's neat at least) is +the +<()+ bit. This is called +http://www.gnu.org/software/bash/manual/bashref.html#Process-Substitution[process +substitution]. It allows us to take the output of a command and use it as if it +were the contents of a file. + + +Category:Bash +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Compiling_KeePassX_2_from_Source_with_Qt_4.8.0.ascii b/src/Compiling_KeePassX_2_from_Source_with_Qt_4.8.0.ascii new file mode 100644 index 0000000..54368bc --- /dev/null +++ b/src/Compiling_KeePassX_2_from_Source_with_Qt_4.8.0.ascii @@ -0,0 +1,78 @@ +Compiling KeePassX 2 from Source with Qt 4.8.0 +============================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I am a huge http://keepass.info/[KeePass] fan. I started using it back in +college (which was oh so long ago...yyeeaaahhh) when I was using Windows. I +later switched to using Linux full time (Ubuntu is definitely a gateway +distro). Sadly, I had to leave behind the wonders of the kdbx format for kdb +because the Linux KeePass version, http://www.keepassx.org[KeePassX], doesn't +support the newer format. But hey, beggers can't be choosers, right? + +A few months back, the developer for KeePassX, debfx, posted on his blog +http://www.keepassx.org/news/2010/09/242[here] that he was completely +rebuilding KeePassX from scratch. With that, I headed straight on over to his +gitorious page and grabbed his source code. Upon trying to build from source, I +met a few issues. First off, here's what I typed to get started. + +From a directory called build inside of the master directory, I ran the +following: + +---- +cmake .. -DCMAKE_INSTALL_PREFIX=~/Desktop/keepassx/keepassx +make +---- + +Running cmake worked fine, but when I ran make I received the following errors. + +---- +/usr/include/QtCore/qscopedpointer.h:207:1: error: stray ‘`’ in program +/usr/include/QtCore/qscopedpointer.h: In member function ‘const T& QScopedArrayPointer<T, Cleanup>::operator[](int) const’: +/usr/include/QtCore/qscopedpointer.h:226:9: error: ‘r’ was not declared in this scope +/usr/include/QtCore/qscopedpointer.h:226:11: error: ‘turn’ was not declared in this scope +/usr/include/QtCore/qscopedpointer.h:226:16: error: expected ‘;’ before ‘this’ +---- + +Oddly it would seem we have a problem with our QtCore stuff. Here's how we fix +this. In my case, I only had to change two things. Both changes need to be made +to **/usr/include/QtCore/qscopedpointer.h**. + +Firstly, head down to line 207. It will look like + +---- +template <typename T,`typename Cleanup = QScopedPointerArrayDeleter>T> > +---- + +Remove the ` + +---- +template <typename T,typename Cleanup = QScopedPointerArrayDeleter<T> > +---- + +Secondly, head down to line 226 which should look like + +---- +r%turn this->d[i]; +---- + +Change the % to the letter e + +---- +return this->d[i]; +---- + +Once you've done that, go back and run the cmake, make, and make install +commands and you should be set. It looks like a lot of work has yet to be done, +but overall it's looking really great. Serious props to debfx for working on +KeePassX. I'm really looking forward to this. + + +Category:Linux +Category:Linux_Applications + + +// vim: set syntax=asciidoc: diff --git a/src/Converting_Disks_in_Hyper-V.ascii b/src/Converting_Disks_in_Hyper-V.ascii new file mode 100644 index 0000000..e7ee1c3 --- /dev/null +++ b/src/Converting_Disks_in_Hyper-V.ascii @@ -0,0 +1,65 @@ +Converting Disks to Hyper-V +=========================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently have been running into space issues. I had a four hundred gigabyte +hard drive that had almost not space remaining. It stored 8 running servers +with dynamically expanding disks that had a maximum size of 40 gigabytes (on +the host it was almost 42 gigabytes). I also had to store a backup server image +(sysprepped) for copying to quickly create a new server if needed. +Additionally, one of the hard drives was 70 gigabytes, not 40. All around, the +total came to 459 gigabytes if each hard drive expanded to its largest.I +suggested to my boss that we should convert each disk to fixed rather than +dynamic disks to improve performance. He agreed and I began my search for how +to convert disks. Much to my delight, converting a disk is a relatively +painless (albeit slow) process. Here's how: + +For starters, *From the window that comes up, *scroll down in* + +*A server must be either off or paused to convert the disk (I chose off +for my conversions)* + +Alright, now that that's out of the way, right click the server you want to +convert. + +image:files/01_ClickSettings_-_X.jpg[height=300] + +From there,*. In my case I only had one hard drive 'attached' to my servers. + +From here, + +image:files/02_HardDiskMainSettings_-_X.jpg[height=300] + +The window that comes up (Edit Virtual Hard Disk Wizard) will start on +the "Locate Disk" step but should continue to the next step +automatically in a few seconds. On the "Choose Action" step, (second +down from the top). + +image:files/04_HardDiskPreConvert_-_X.jpg[height=300] + +This will take you to the "Convert Disk" step. Here you need to set the +destination filename for the conversion. In my case, I just selected the old +file from the browse window and added a "_fixed" at the end of the filename. +Any naming scheme works though of course. + +image:files/07_HardDiskConverting_-_X.jpg[height=300] + +From here, just sit back and relax. + +The conversion speed at the beginning can be a little deceiving. Mine got +almost 25% done in the first five minutes. It actually took it about an hour to +complete for forty gigabytes though. Reminds me of a cell phone. It reads full +battery power until it has none left and then it says it has none five minutes +before turning off. + + +Category:Microsoft + +Category:Virtualization + + +// vim: set syntax=asciidoc: diff --git a/src/Converting_Hyper-V_VHDs.ascii b/src/Converting_Hyper-V_VHDs.ascii new file mode 100644 index 0000000..9585a29 --- /dev/null +++ b/src/Converting_Hyper-V_VHDs.ascii @@ -0,0 +1,53 @@ +Converting Hyper-V VHDs +======================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently was assigned the task of rebuilding our Team Foundation Server with +TFS 2010 for many reasons. One of those is because the old one has a VHD that +is consuming far more resources than it should be (it's a 100 gigabyte vhd and +only 8 gigabytes are in use). I seemed to recall somewhere that Hyper-V could +"compact" a virtual hard drive, but I couldn't remember where. After doing a +bit of searching around Hyper-V, I found what I needed. Here's a few facts +about this before getting started. + +First, shrinking a hard drive only applies to Dynamically sizing disks. Since +these do no shrink on their own (there's a lot of reasons why) but only grow, +they might need to be compacted later to free up host space. It only reduces +the .vhd file size by shrinking the 'shell' (if you will) to take up the drive +space that is not being used by the guest OS. + +In my situation, I was dealing with a drive that was not dynamically sizing but +was static. If the vhd is static, the Compact button will not show up when you +go to edit the drive. + +In my case, I did not have to compact the drive. As I said, a drive cannot be +compacted unless it is dynamic. Since mine was static, I converted it to +dynamic to regain the compacting functionality but because of the way the +conversion process works, it automatically 'compacts' the .vhd. My original +static .vhd was 100 gigabytes. The output was 15.5 gigabytes. + +Though I did not have to compact my .vhd because the conversion process did it +for me, I'm going to put the instructions on how to compact the .vhd anyways. + +For starters, the virtual machine that the hard drive is attached to must be +turned off. Once the server is offline, from within the Hyper-V Manager (it's +an mmc snap-in) go to the virtual machine's properties (right click the machine +and select properties). Select the drive you want to shrink on the left panel +that lists the various devices attached to the virtual machine. After selecting +the drive, on the right panel, select Edit. This will bring up a window that +tells you what editing a drive does and gives you the option to not show that +screen again. Click Next. From here you should have three options (unless the +.vhd is static). Select Compact and click Next. Finally, click Finish and +Hyper-V Manager will shrink the .vhd as much as it can. + + + +Category:Microsoft +Category:Hyper-V + + +// vim: set syntax=asciidoc: diff --git a/src/Cool_Vim_Trickery.ascii b/src/Cool_Vim_Trickery.ascii new file mode 100644 index 0000000..cc5e293 --- /dev/null +++ b/src/Cool_Vim_Trickery.ascii @@ -0,0 +1,115 @@ +Today I was toying with something absolutely not work related and I wanted to +share it with somebody to show how awesome the vim text editor can be. + +First though, I really would like to thank Bram Moolenaar for contributing such +a useful tool to the world. It may not be the easiest thing in the world to +learn, but once you've got even the most basic functionality figured out, you +can do so much more than other editors will allow. That all goes without even +saying how cool its interface is. If you realy like vim, you should head on +over to http://www.vim.org/index.php[his website] and buy a +http://www.freewear.org/?org=Vim[tshirt], +http://www.vim.org/stickers.php[sticker], or a +http://www.vim.org/posters.php[poster]. + +What I was dabbling with was vim colors for syntax highlighting. It turns out +that the stock install of vim for Arch linux comes with almost 200 color +schemes. I really wanted to see them all but didn't want to have to keep typing +":colors schemename". That is a lot of repeat key presses after all, something +we Linux folk really are not fond of when faced with a situation that a +computer can handle for us (automation - what a novel idea). + +After some searching, I discovered +http://vim.wikia.com/wiki/Switch_color_schemes#Switching_colors[this vim +script] that will change your color scheme forwards or backwards by pressing F8 +or Shift+F8, respectively. Really neat, but not super automated still. Who +wants to set this sucker to a timer and watch it switch every 200 milliseconds? +I do I do I do! + +That vim script provides a few functions that are bound to the afforementioned +hotkeys. The function we are immediately concerned with is called +_NextColor_. This will switch the color scheme to the next in the list. + +Here's where vim gets really cool, even though it already is. + +It turns out that there is a list in this vim script that is a statically coded +array of scheme names, so if you have more themes installed than those listed +in the array, you're out of luck unless you manually add them. Now, at this +point we could probably have vim run a shell command and massage the output to +make an array for us at runtime, but where's the fun in that (that's just a +little TOO automated for the purposes of this article)? I want to rock some vim +find and replace regex! + + +[[inserting-shell-command-output]] +== Inserting Shell Command Output + +So now, the first thing we're going to do is insert the output of a shell +command to our vim file, specificall +ls -1+. When in command mode, run + +---- +:read !ls -1 /usr/share/vim/vim73/colors/ +---- + +This should insert a metric bitt load (teehee) of lines if you have very +many color schemes. + + +[[ranges-in-regex]] +== Ranges in Regex + +From here, we want to massage the data with a few vim find and replace regexes. +Establish the line that your file list ends at. For me, this was line 207, but +this very likely won't be the case for you. Move the cursor to the first line +and run the following in command mode + +---- +:.,207s/\.vim// +---- + +This will do a find and replace on the text range starting where the cursor is +currently (the .) and ending at line 207 (the 207). After that it's just a +standard regex substitution. This should chop off the '.vim' at the end of each +filename. + +Next, we need to remove the new lines, comma delimit, and encase in single +quotes to match the array format. Again, place your cursor at the first line of +your list. Remember the line number of the last line in the list? + +---- +:.,207s/\(.*\).vim\n/'\1', / +---- + +In this cryptic regex, we replace from the current line (the .) to line 207 any +line containing .vim with a line break after it (the .vim\n) with the text +preceeding the .vim ( captured by +<\(.*\)+), encasing that value with single +quotes and ending with a comma space (the +'\1',+) encase the entire string +with a [ ] and you'll be set. Just erase the old array set your new one to ++s.mycolors+ near the top. + + +[[setting-the-rotate-timer]] +== Setting the Rotate Timer + +Now there's one piece left: set the timer. In command mode, do the following +and hit enter + +---- +:while 1 | sleep 1000m | call NextColor(1) | endwhile +---- + +That will rotate through every theme you just added to your array every 1000 +milliseconds. Just change the +1000m+ to whatever you want to make it update at +different intervals. + +Hello worthless but super awesome functionality! + +---- +:while 1 | sleep 1000m | call NextColor(0) | endwhile +---- + + +Category:Linux +Category:Vim + + +// vim: set syntax=asciidoc: diff --git a/src/DNS_Backup_Script.ascii b/src/DNS_Backup_Script.ascii new file mode 100644 index 0000000..ad6f3db --- /dev/null +++ b/src/DNS_Backup_Script.ascii @@ -0,0 +1,105 @@ +DNS Backup Script +================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I would like to start this post with an admission of guilt. + +Hello, my name is swarleyman and I'm an arstechnicaholic. + +Please don't judge me. + +Anyways, I was reading it a few days ago and read +http://arstechnica.com/business/news/2012/03/how-anonymous-plans-to-use-dns-as-a-weapon.ars[an +article] about how Anonymous plans to dos worldwide DNS. All the politics of +this topic aside, it got me thinking. We are so incredibly reliant on DNS that +if it went down, it could have catastrophic effects on society. Okay, so not +being able to access your Facebook page for a few days might be a good thing. +What about paying your bills (though if your bill pay system can't access their +payment processing service, it doesn't really matter anyways)? With that, I +decided to research a good way to back up DNS. + +After some searching I was, of course, disappointed. There is apparently no way +to back up DNS. You would think that there should be some way to make a +third-party copy, especially since it's such a vital service that's supposed to +be relatively open. Either way, we still have a few tools to work with to make +at least a semi-thorough backup. + +The tools I chose to use were perl and nslookup. Unless I'm missing something, +I think nslookup is really the only good way to get relatively complete DNS +data. I know you can dig stuff, but i'm not looking to back up people's cname, +aaa, a, srv, etc. records (perhaps I'll come back and write up a script for +that too). With that, to run this script you need a 'nix system with perl and +nslookup installed (in the dnsutils package). + +What this script does is run nslookup on every host in a text file (for example +./dnsbak.pl hostlist.txt), parse the text and format it in a hosts file format. +All you should need to do is take the output from this script and append it to +your hosts file and you should be back up and running. + +Here's teh codez! + +---- +#!/usr/bin/perl -w +sub main () { + open hosts_list, $ARGV[0] or die("\nNo file specified or file does not exist\n"); + # ONE HOST PER LINE + my @hosts=<hosts_list>; + close(hosts_list); + for (my $i=0; $i<scalar(@hosts); $i++) { + my $nslookup=`nslookup $hosts[$i]`; + my $site = new Site($nslookup); + $site->parse(); + sleep(1); + } +} +main(); +print "\n\n"; + +package Site; +sub new { + my $class = shift; + my $self = { _nslookupData=>shift }; + bless $self, $class; + return $self; +} + +sub parse() { + my ( $self )=@_; + my $data=$self->{_nslookupData}; + my @data=split("\n", $data); + my @addresses; + my $server; + for (my $i=0; $i<scalar(@data); $i++) { + if ($i>=3) { + # MATCH THE HOSTNAME + if ($data[$i]=~/Name:\s(\w+\.\w+)/) { $server=$1; } + # MATCH THE IP ADDRESSES + if ($data[$i]=~/Address:\s{1,3}(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) { push(@addresses, $1); } + } + } + if (scalar(@data) > 4) { + print join("\t".$server."\n", @addresses); + print "\t".$server; + print "\n\n"; + } +} +---- + +Please leave some comments on my script if you have any. I still consider +myself quite the perl noob as I am completely self taught and don't really have +all of the super pro +1 up perl one-liner guru experience that you perl +veterans http://icanhascheezburger.com/[can has]. I look forward to hearing +some feedback on my seemingly too long and verbose script. + +Ensign, engage. + +Category:Backups +Category:Perl +Category:Scripting + + +// vim: set syntax=asciidoc: diff --git a/src/Duplicating_a_USB_Stick_with_dd.ascii b/src/Duplicating_a_USB_Stick_with_dd.ascii new file mode 100644 index 0000000..6f61874 --- /dev/null +++ b/src/Duplicating_a_USB_Stick_with_dd.ascii @@ -0,0 +1,79 @@ +Duplicating a USB Stick with dd +=============================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have a USB stick that I use for fixing friends computers (among other things) +that runs Arch Linux. It seems that their most frequent problems are either +crashed hard drives or a virus that makes their computer unusable. The quick +solution to backing their data up in either case is to boot an external drive +and use that OS to copy the data off their drive (assuming you can still get to +it that is). Unfortunately, flash memory has a maximum number of times that you +can write to it, which I hit a bit quicker than I'd like running an operating +system off of a USB stick. As you likely guessed, my USB stick is failing +(remarkably I've been using it to do this for several years). + +Last night whilst (oh yes, whilst) brushing my teeth, I had an epiphany. I +realized that instead of re-installing Linux on a new USB stick, I could use dd +to duplicate one USB stick onto another. I tried it, and sure enough, it works +almost perfectly. I say almost because there was one minor problem that I will +get to in a minute. Firstly though... The command *dd* is used for making +bit-for-bit duplicates or data. In this case, we're duplicating the exact bits +on one device (a USB stick) to another device (another USB stick). You can +actually use dd to duplicate most Linux ISO installation files onto a USB stick +as well. It works very similarly to burning a CD. Now that that's explained, +here's the command I used. + +Assuming my source USB stick is at /dev/sdb and my destination stick is at +/dev/sdc (partitions don't matter here because we're duplication the entire +drive, not just one partition). + +---- +dd if=/dev/sda of=/dev/sdb +---- + +(The *if* is the "input file" and *of* is the "output file") That will likely +take a while. For me it ran at 2.3 megabytes per second. Yours might run a bit +slower as my destination USB stick has an average write speed of 25 MBps which +is a bit higher than typical USB sticks (many thanks to Newegg for the great +price). On the flip side, my source usb stick was starting to fail, so it might +go way faster. I'm not really sure. + +Okay, now that one issue I had. + +Two different 8 gigabyte USB sticks (that's what I used) are likely not going +to have the exact same amount of space on them. If your destination USB stick +is even slightly smaller than your source disk, you'll miss some data due to +the disk being full (in the case of dd, even empty space has bits in it that +get transferred). This will cause problems for you because the filesystem will +say that it starts here and ends there, when the actual partition ends earlier +than expected. While this likely won't cause issues for you other than your +machine complaining about it, it could result in some data loss. Either way, +the way we get around this issue is really simple. Once you've duplicated your +USB stick and booted the new one, you should see the following error: + +---- +The filesystem size (according to the superblock) is derpderpderp blocks The +physical size of the device is blerdibler blocks +Either the superblock or the partition table is likely to be corrupt! +---- + +Just run this command and it should solve your issue + +---- +resize2fs /dev/sd-lastpartition +---- + +In my case that command was *resize2fs +/dev/sdb4* (my /home partition). + +May there be utility USB sticks for all! + + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Encrypting_Home_Directories_with_EncFS.ascii b/src/Encrypting_Home_Directories_with_EncFS.ascii new file mode 100644 index 0000000..a8b8dbb --- /dev/null +++ b/src/Encrypting_Home_Directories_with_EncFS.ascii @@ -0,0 +1,84 @@ +Encrypting Home Directories with EncFS +====================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Before I go into how to do this, I'd like to take a moment to explain how encfs +works in slightly simpler terms than are detailed on the +http://www.arg0.net/encfsintro[encfs introduction page]. Originally, I was +going to write my own explanation, but the Wikipedia article on this explains +it so much better than I did (I just erased several paragraphs after reading +the Wikipedia article). + +____ +EncFS is a Free (GPL) FUSE-based cryptographic filesystem that transparently +encrypts files, using an arbitrary directory as storage for the encrypted +files. +____ + +Two directories are involved in mounting an EncFS filesystem: the source +directory, and the mountpoint. Each file in the mountpoint has a specific file +in the source directory that corresponds to it. The file in the mountpoint +provides the unencrypted view of the one in the source directory. Filenames are +encrypted in the source directory. Files are encrypted using a volume key, +which is stored encrypted in the source directory. A password is used to +decrypt this key." + +http://en.wikipedia.org/wiki/Encfs[Original article] + +Wow. How was that for an explanation? I love Wikipedia. + +Now that that is out of the way, let's get on to business... + +To start things off, we have to create our two directories, the source +directory and the mountpoint directory. Both should be owned by the user using +the encrypted data. + +---- +mkdir /home/.user && chown -R user:user /home/.user +mkdir /home/user && chown -R user:user /home/user +---- + +*.user* is the +encrypted data. You don't ever write data to this directory. EncFS +handles this for you. **user** is the decrypted data/the mountpoint. You +ONLY write data here. When you write data here, it shows up in .user as +encrypted data. + +---- +encfs /home/.user /home/user +---- + +This will mount /home/.user at the mountpoint /home/user. Without getting too +specific, what happens is when data is written to /home/user, the data goes +through EncFS which encrypts that data before writing it to /home/.user/. When +data is read from /home/user/, the request goes through EncFS, which grabs the +encrypted version of the file from /home/.user/ and temporarily decrypts it in +RAM for your use. Ah the beauty of the seamless Linux mounting paradigm +(that's para-dig-um, not paradigm). + +Since we are encrypting an entire home directory, we need to use a nonempty +parameter for Fuse since the home directory will always contain something like +\.bash_history from a command line login, or .local from a GUI login. Here's +our final command. + +---- +encfs -o nonempty /home/.user /home/user +---- + +And with that, you have an entirely encrypted home directory. + +On a final note, be sure you keep the file located at /home/.user/.encfs6.xml +backed up. That file contains all the data that EncFS needs to use your +encrypted data. Without this, retreiving your data will be a lot more +difficult. + + +Category:Linux +Category:Encryption + + +// vim: set syntax=asciidoc: diff --git a/src/Finding_Prime_Factors.ascii b/src/Finding_Prime_Factors.ascii new file mode 100644 index 0000000..83ba164 --- /dev/null +++ b/src/Finding_Prime_Factors.ascii @@ -0,0 +1,77 @@ +Finding Prime Factors +===================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have been working in my spare time on the https://projecteueler.net[Euler +project] problems. Now, for most languages, these problems aren't too big of a +deal, because most modern languages do much of the work for you (at least on +the early problems). I'm working on learning c++ though, and it doesn't do a +lot of the work for you, which is great in my opnion. One thing it's really +helping me with is number theory (or whatever it would actually be called). I +never went to school for computer science, so I lack much of the math that many +developers have. That said, nealry every problem that Euler has, is a really +great test, not only of programming ability, but of number knowledge. + +My most recent problem I've been working on is refactoring my code to solve +https://projecteuler.net/problem=3[problem 3]. Now, this problem isn't that +difficult. Where the difficulty lies is in the calculation speed. My original +program solved this one in about ten minutes I think (again, if you're sporting +something like ruby, php, perl, etc, you have probably solved this faster +because they built good calculation methods into the language). In going bad to +refactor though, I've been focusing more on wasy to more efficiently calculate +these things via brute force (I'm sure there's an equation for this out there, +but I'm using a for loop). Here is the list of things that I found to speed up +the calculation process. + + +[[calculating-factors]] +== Calculating Factors + +A factor is a number that an original number is divisible by (eg: the factors +of 10 are 1, 2, 5, and 10). + + +[[dont-go-above-half]] +=== Don't go above half + +When you are finding factors, you are not finding them one at a time. Each +time you find a factor, you find its counterpart. For example, the factors of +20 are 1, 2, 4, 5 , 10, 20. When you are looping through starting at 1 and you +find that the number 20 is divisible by 2, you also know that its counterpart +is 10 (20/2). When you find the next factor, 4, you have also found the factor +5 (20/4 = 5), and so on. This means that your calculation time should be cut in +half becuase you only have to calculate up to half of the original number (20 +in our example). One more example to help visualize this, a table. Everyone +loves tables! + +Factors of 20 + +[cols=",",options="header",] +|=================== +|Factor |Counterpart +|1 |20 +|2 |10 +|4 |5 +|5 |4 +|10 |2 +|20 |1 +|=================== + +See the overlap at 4 and 5? + + +[[only-calculate-evens-or-odds]] +==== Only Calculate Evens or Odds + + +[[calculating-primes]] +=== Calculating Primes + +Category:Drafts + + +// vim: set syntax=asciidoc: diff --git a/src/Finding_the_Absolute_Path_of_a_Bash_Script.ascii b/src/Finding_the_Absolute_Path_of_a_Bash_Script.ascii new file mode 100644 index 0000000..73a69e3 --- /dev/null +++ b/src/Finding_the_Absolute_Path_of_a_Bash_Script.ascii @@ -0,0 +1,57 @@ +Finding the Absolute Path of a Bash Script +========================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +This seems to be one that a lot of people want to know how to do (I was one of +them). In searching the internets I found a lot of suggestions to use the +_readline_ external command. I need to have the script that uses this work on +Linux and AIX though, which means readline and many other external commands +will not be available to me. Here's how it can be done in bash + +---- +# +# Determines the absolute path to the running script. This is useful for +# needing to muck around in the running directory when the script has been +# called using a relative path +# +getScriptAbsolutePath() { + if [[ ${0:0:1} == '/' ]]; then + # If the script was called absolutely + absPath=${0} + else + # If the script was called relatively, strip the . off the front + script=`echo ${0} | sed 's/\.\?\(.*\)$/\1/'` + absPath="$(pwd)/${script}" + fi + # Strip the script filename off the end + absPath=`echo ${absPath} | sed 's/\(.*\/\).*\$/\1/'` +} +---- + +So what we do here is start with two variables: The working directory (output +of pwd), and command used to call the script ($0). The command used to call the +script could be anything like + +* +./blah.sh+ +* +./scripts/blah/blah.sh+ +* +/usr/local/res/scripts/blah/blah.sh+ + +If argument 0 starts with a / (such as /usr/local/res/scripts/blah/blah.sh), +the script was called using an absolute path, so we can just use $0 as our +absolute path once we strip the script name off the end. + +If otherwise, the script was called using a relative path and $0 needs to be +appended to the output of pwd and to get the absolute path. Using sed, we strip +off the leading period if it exists as well as the script filename. + + +Category:Linux +Category:Bash +Category:Scripting + + +// vim: set syntax=asciidoc: diff --git a/src/Fixing_Android_Mac_Address_Conflicts.ascii b/src/Fixing_Android_Mac_Address_Conflicts.ascii new file mode 100644 index 0000000..06c8f55 --- /dev/null +++ b/src/Fixing_Android_Mac_Address_Conflicts.ascii @@ -0,0 +1,102 @@ +Fixing Android MAC Address Conflicts +==================================== + +If you already know this is the fix for your issue, you can skip this section. +Otherwise, I'll get on to describing the problem. + +I have been frustrated for the last few days with my phone. I have run +CyanogenMod for a while now on my LG G3 (since the early alpha builds), while +my wife ran a variant of the stock carrier rom. However, due to poor battery +life issues, she wanted to have CyanogenMod since my phone gets about twice as +much battery life than hers does. Obligingly, I flashed CyanogenMod on her +phone. That night I noticed a problem was occuring with both of our phones, +which I unfortunately didn't realize the source of until today. + +[[symptoms]] +Symptoms +~~~~~~~~ + +The symptoms of the issue were wifi was repeatedly dropping. Rebooting wifi +and/or toggling airplane mode would fix the issue for a few minutes, but it got +progressively worse. A few hours before writing this post, it was so bad I +could only maintain a wifi connection for about 10 seconds before it would fail +and not even try to reconnect for about five minutes. + +[[the-problem]] +The Problem +~~~~~~~~~~~ + +After puzzling through the issue, it occured to me what it must have +been: conflicting mac addresses. + +I checked my wife's and my phones and sure enough, their mac addresses were +identical, specifically **00:90:4c:c5:12:38**. I did some Googling and found +many other people to have the same issue in varying versions and roms of +Android. After some hunting, I found a +http://forum.cyanogenmod.org/topic/105128-wifi-bug-cm12/[temporary fix], but +the fix was for a different phone, which stored its config files in a different +location (oddly). I did a bit of digging through the filesystem (+find /system +-type f -exec grep -H macaddr "\{}" \;+) and finally found the file that needed +to be modified for my phone/version of Android. For reusability purposes, I +also turned this into a _fairly_ friendly script so other folks can do it too. + +Note though that this issue is very obscure and the likelyhood of seeing is it +slim. Only people running at least two phones with this bug at the same time +and on the same wifi network will experience this issue. This is why my phone +operated fine for months until I put CyanogenMod on my wife's phone and she +connected to our wifi. Further (to the credit of the CM and the various other +Android devs out there), this problem would be tremendously difficult for a dev +to track down because it is only problematic with two or more phones, something +I doubt most devs are testing at the same time with. + +[[the-fix-script]] +The Fix Script +~~~~~~~~~~~~~~ + +This script needs to be run as root to work correctly (if you don't run it as +root, it'll complain at you and exit). Once you've run this script as root, +simply reboot your phone and your new mac address will take effect. + +---- +#!/system/xbin/bash + +# Ensure we are running as root, because this won't work otherwise. +uid=$(id | sed -n 's/uid=\([0-9]\+\).*/\1/p') +if [[ ${uid} != 0 ]]; then + echo "Not running as root. Cannot proceed. Exiting..." + exit 1 +fi + +echo "Remounting /system with write access so we can make the modification." +mount -o remount,rw /system + +# The path to the wlan cal file +cal_path=/system/etc/wifi/bcmdhd.cal + +# Don't need this, but might be handy to have documented +#old_mac=00:90:4c:c5:12:38 + +# Generate the new mac address +new_mac=$(printf '00:90:4c:%02x:%02x:%02x\n' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]) + +# Sed expression to replace the mac address with something less problematic +sed -i "s/macaddr=.*/macaddr=${new_mac}/" ${cal_path} + +echo "Your new mac address is ${new_mac}." +---- + +I personally placed this on my internal storage at /storage/sdcard0/mac_fix.sh. +To execute it, as root just run... + +---- +bash /storage/sdcard0/mac_fix.sh +---- + +Note the preceeding call to the bash command. Ordinarily you would be able to +set the execute bit on the script and directly call it. However, Android +defaults to setting the noexec mount option for the sdcard filesystems (both +sdcard0 and sdcard1), thus chmod +x doesn't work. This could be worked around +in the script, but it would make it longer and I don't see the need for it. :) + + +// vim: set syntax=asciidoc: diff --git a/src/Git:Branch_Author_List.ascii b/src/Git:Branch_Author_List.ascii new file mode 100644 index 0000000..2a46d45 --- /dev/null +++ b/src/Git:Branch_Author_List.ascii @@ -0,0 +1,62 @@ +Git:Branch Author List +====================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Whether your team uses the long-running, topic, or any other multi-branch +https://git-scm.herokuapp.com/book/en/v2/Git-Branching-Branching-Workflows[branching +workflows], you usually end up with many server-side "abandonded" branches that +haven't been commited to in a while, especially when the team is relatively +agile. While a cluttered server-side branch set it isn't always a pressing +issue, the difficulty in cleanup can make it be a long-standing issue; one that +gets worse and worse as time goes by. + +Enter, the *git-branch-authors.sh* script. + +I wrote this script because my team has the problem I described above. To +preface the source code though, git doesn't track _who_ created a branch. It +just tracks at which commit reference the branch was forked from its parent, +which means we can't actually tell _who_ created a given branch. However, since +a branch is usually commited to by its creator, we can make an educated guess +by using the name of the person who commited most recently. At the very least, +the most recent author will give a point of contact to help find out +information about the branch. + +---- +#!/usr/bin/env bash + +# Verify we're inside a git repo +git status 2>/dev/null 1>/dev/null +if [[ $? != 0 ]]; then + echo "Error: '$(pwd)' is not a epository." + exit 1 +fi + +# Set the column headers +out='Unix Timestamp~Branch~Timestamp~Commit~Author~Relative Time' + +# Parse the branches +for i in $(git branch -r | grep -v HEAD); do + format="unix:%at~${i}~%ai~%h~%an <%ae>~commited %ar" + cmd=$(git show "${i}" --format="${format}" | head -n 1) + out=${out}'\n'${cmd} +done + +# Output the goodness +echo -e ${out} | sort -r -n | column -s '~' -t + +---- + +To use this, simply save it to your *~/bin* directory (ensure your PATH +variable has \~/bin in it or that won't work) and +chmod \+x +~/bin/git-branch-authors.sh+. + +Category:Bash +Category:Scripts +Category:Git + + +// vim: set syntax=asciidoc: diff --git a/src/Git:Changing_Project_Licensing.ascii b/src/Git:Changing_Project_Licensing.ascii new file mode 100644 index 0000000..d2967d6 --- /dev/null +++ b/src/Git:Changing_Project_Licensing.ascii @@ -0,0 +1,60 @@ +Git:Changing Project Licensing +============================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I'm unsure about the legality of doing something like this. I think though that +this probably shouldn't be used if you've already released your project. If +however you have not yet released and have changed your mind to use a different +license prior to its release, this may be just the post for you. + +I recently was working on a project that prior to releasing, I decided upon +using the Apache V2 license. After something thinking though (and about 10 +commits), I decided I wanted to release this project under the copyleft +http://www.gnu.org/licenses/gpl-2.0.html[GPL v2] license. Unfortunately +though, I had already commited the LICENSE file as well as put the shortened +license header at the top of my program's files. Thankfully, git has a +solution to fix this problem. However, we will have to fix this in two steps +since we will be rewriting a certain file as well as deleting another entirely +(LICENSE). + +[[removing-a-file-section-throughout-history]] +== Removing a File Section Throughout History + +---- +git filter-branch -f --tree-filter "if link:\$(grep_'Apache'_somefile)[\$(grep 'Apache' somefile)]; then sed -i -e '2,16d' somefile; fi" +---- + +What this does is modify the contents of file **somefile**. Effectively, for +each commit in history (+git filter-branch --tree-filter+), this checks if the +file *somefile* contains the string __Apache__. If it does, it then uses sed to +do an inline edit to delete lines 2-16 (those are the lines containing my +license header). You will likely need to change those since not all license +headers are the same length (and don't start at line 2). + +[[deleting-a-file-from-history]] +== Deleting a File From History + +Now that we've cleaned out the license header, we just need to remove the +LICENSE file from all of history so we can put a new one in. To do this, we're +going to use the *--index-filter* switch. + +---- +git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch ./LICENSE' +---- + +Something to note about the _git rm_ command we just ran. Notice the +_--ignore-unmatch_ switch. That will make git rm return a 0 status even if the +specified file is not found. Basically, that means that it will keep the git +filter-branch command from exiting when it happens upon a commit where the file +doesn't currently exist. + + + +Category:Git + + +// vim: set syntax=asciidoc: diff --git a/src/Git:Clone_All_Remote_Repos.ascii b/src/Git:Clone_All_Remote_Repos.ascii new file mode 100644 index 0000000..77d0523 --- /dev/null +++ b/src/Git:Clone_All_Remote_Repos.ascii @@ -0,0 +1,109 @@ +Git:Clone All Remote Repos +========================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +To my knowledge, there isn't a good way to clone all git remote repos in a path +that doesn't involve either installing a program or writing a script. That +said, here's the script I wrote to do it. + +---- +#!/usr/bin/env bash +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# @author nullspoon <nullspoon@iohq.net> +# + +argv=( ${@} ) +for (( i=0; i<${#argv[*]}; i++ )); do + if [[ ${argv[$i]} == "-u" ]]; then + user=${argv[$i+1]}; + i=$[$i+1] + elif [[ ${argv[$i]} == "-s" ]]; then + server=${argv[$i+1]}; + i=$[$i+1] + elif [[ ${argv[$i]} == "-r" ]]; then + rbase=${argv[$i+1]}; + i=$[$i+1] + elif [[ ${argv[$i]} == "-l" ]]; then + lbase=${argv[$i+1]}; + i=$[$i+1] + fi +done + +if [[ -z $user ]]; then + echo -e "\nPlease specify the user (-u) to log in to the remote server as.\n" + exit +elif [[ -z $server ]]; then + echo -e "\nPlease specify the server (-s) where the remote repos are located.\n" + exit +elif [[ -z $rbase ]]; then + echo -e "\nPlease specify a base path (-r) where the repos are located on the remote.\n" + exit +elif [[ -z $lbase ]]; then + echo -e "\nPlease specify a desginated path for local clone (-l).\n" + exit +fi + +# Escape our base path for use in regex +rbase_esc=$(echo $rbase | sed 's/\//\\\//g') + +if [[ ! -e $lbase ]]; then + echo -n -e "\n$lbase does not exist. Create? [Y/n] " + read -n 1 c + if [[ $c == y ]]; then + mkdir $lbase + else + echo + exit + fi +fi +echo -e "\nCloning all...\n" + +# Get our repo list +#conn="ssh -q ${user}@${server}" +cmd="find $rbase -name \"*.git\"" +repos=( $( ssh -q ${user}@${server} ${cmd} | sed 's/$rbase_esc\(.*\)/\1/' ) ) + +# This is so we can easily handle relative destination paths +start_path=$(pwd) +for(( i=0; i < ${#repos[*]}; i++ )); do + # Clean up our strings first + lrepo=$( echo ${repos[$i]} | sed 's/\(.*\)\.git/\1/' ) + lrepo=$( echo ${lrepo} | sed "s/$rbase_esc\(.*\)/\1/" ) + labs_path=$( echo "${lbase}/${lrepo}" | sed 's/\/\{1,\}/\//g' ) + rabs_path=$( echo "${repos[$i]}" | sed 's/\/\{1,\}/\//g' ) + # Do some real work + mkdir -p "${labs_path}" + cd "${labs_path}" + echo -e "\nFetching ${user}@${server}:${rabs_path}\n" + # Clone the remote + cd .. + git clone ${user}@${server}:${rabs_path} + # Do not pass Go + cd ${start_path} +done +---- + + +Category:Linux + +Category:Git + + +// vim: set syntax=asciidoc: diff --git a/src/Git_as_a_Backup_Solution.ascii b/src/Git_as_a_Backup_Solution.ascii new file mode 100644 index 0000000..6c13353 --- /dev/null +++ b/src/Git_as_a_Backup_Solution.ascii @@ -0,0 +1,102 @@ +Git as a Backup Solution +======================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +To preface this post, I would like to point out two very key things. The backup +files will be stored in two branches inside of a single repository. Those +branches will be called "files" and "database". You may choose to use other +names (such as database and master) but for the purposes of this post, the +afforementioned names will be used. + +If it suits you better, you could also use two git repositories. I used that +for a while and it worked great. I just found it more convenient to have the +database dumps and the wiki files in one repository for simplicity. + +[[files-checkin]] +Files Checkin +------------- + +This will catch all upgrades, uploads, settings file changes, etc. +Anything you change on the actual filesystem where your wiki is stored +will be commited to the repository. + +---- +export repo = 127.0.0.1 +# Check in the files +cd /path/to/your/wiki + +# Add all new, edited, and deleted files +git add . -A +# Commit our changes +git commit -m "Routine Checkin" +# Push the commit to the files branch of our repository +git push origin files +---- + + +[[database-checkin]] +Database Checkin +---------------- + +For this we are going to take a database dump and overwrite the old one +with it. We will then check in the same file, but with the changes. +Again, any changes made to pages, users, logs, etc will be in the dump +file and thus will be commited to the repository. + +---- +dbFileName = "wiki.data.sql" +$password = "CheckMeYo" +$dumpPath = /path/to/dump/backups/ +mysqldump -u wikiUser -p$pass 'databaseName' > $dumpPath$dbFileName +cd $dumpPath +git add . -A +git commit -m "Routine Checkin" +# Push the commit to the database branch of our repository +git push origin database +---- + + +[[restoring-from-backups]] +Restoring from Backups +---------------------- + +Restoring from a backup is actually quite simple. All one needs to do is +fetch the repository (origin). + +* Firstly, pull the database branch and run a mysqlimport on the dump + file. +* Secondly, to get the files (and overwrite any current files), do a + +---- +git pull --rebase origin files +---- + +and the most recent version of the files branch will show up in the current +directory. + +Also, if you worry someone will download your .git directory contents, you can +just move the .git directory out when you aren't doing backups and back in +temporarily for a backup. + + +[[size-concerns]] +Size Concerns +------------- + +Git has the capability to compress repositories using the *git gc* command. +This will have git go back through all of the commits in the working repository +and compress them in the context of all of the other commits. Currently my wiki +plaintext database dump is 50 megabytes. It has been checked in to the +repository 18 times and the entire repository is about 17.5 megabytes after a +"git gc". Neat, huh? + + +Category:Git +Category:Backups + + +// vim: set syntax=asciidoc: diff --git a/src/Google_Apps_Users_:_Cannot_Use_Self-hosted_XMPP.ascii b/src/Google_Apps_Users_:_Cannot_Use_Self-hosted_XMPP.ascii new file mode 100644 index 0000000..df195a6 --- /dev/null +++ b/src/Google_Apps_Users_:_Cannot_Use_Self-hosted_XMPP.ascii @@ -0,0 +1,70 @@ +Google Apps Users Cannot Use Self-hosted XMPP +============================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Just over a week ago, Google released Google Plus for its Google Apps + +users (see Google's post +http://googleenterprise.blogspot.com/2011/10/google-is-now-available-with-google.html[here]). +I won't lie that despite my hesitation about centralized social networks, I was +pretty excited about this. I've been receiving invitations from all of my +friends on my old non-apps GMail account for some time now, so I was eager to +move them on over to my Google Apps account. + +[[enter-google-plus]] +Enter Google Plus +----------------- + +As soon as it was enabled for my account, I went straight to the control panel +to turn it on. I was met with an unfortunate message indicating that I needed +Google Chat enabled to use Google Plus (it was disabled because I run my own +Jabber server on bitnode.net and not on a subdomain). My thought was "I'll just +enable it for a little while and then turn it back off once I've had my fun"... +so off I went. + +Oops + +As it turns out, when you try to turn off Google Chat, it just won't go. I +need to clarify here before going on. When I say turn off, I mean you disable +Chat and uninstall it. When I say "it just won't go" I mean, it doesn't show up +in your control panel as either installed or enabled, but when your Jabber +server tries to connect to the Google Chat servers to check for the statuses of +all of your friends, you receive the following error: + +---- +=INFO REPORT==== yy-mm-dd hh:mm:ss === +D(<0.384.0>:ejabberd_receiver:320) : Received XML on stream = "<stream:error><undefined-condition xmlns=\"urn:ietf:params:xml:ns:xmpp-streams\"/><str:text xmlns:str=\"urn:ietf:params:xml:ns:xmpp-streams\">'''bitnode.net is a Google Apps Domain with Talk service enabled.'''</str:text></stream:error></stream:stream>" +---- + +I have Googled around, and even used Bing to see if there is a workaround for +this. Sadly, all I have found are people having the same issues. My guess (or +perhaps just a hope) is this is just a bug caused by the introduction of Plus +to Google Apps since everything seems to work fine with no errors when you +disable Chat. Time will tell. My Google Plus and Google Talk have been disabled +since October 28 and still no change sadly. Here are most of the resources I +have found referencing this issue. + +* http://jcsesecuneta.com/labox/google-apps-xmpp-chat-bug[John Cuneta's +blog talking about having the same issue] +* http://jcsesecuneta.com/labox/google-plus-for-google-apps-is-not-xmpp-jabber-friendly[John +Cuenta's second post regarding this issue] +* http://www.google.com/support/forum/p/Google+Apps/thread?tid=4aceb036c7ff5abe&hl=en&fid=4aceb036c7ff5abe0004b13a929df8ea[The +Google Support Thread] +* http://www.google.com/support/forum/p/Google+Apps/thread?tid=1c3107cfc528d6fa&hl=en[The +Other Google Support Thread] +* http://www.google.com/support/forum/p/Google+Apps/thread?tid=0f021783dd77e152&hl=en[The +Other Other Google Support Thread] +* http://olegon.ru/showthread.php?t=11181[Olegon's Forum Thread (на +русском языке)] + + +Category:Google + +Category:XMPP + + +// vim: set syntax=asciidoc: diff --git a/src/How_to_Uninterest_Me_in_Your_Job_Opening.ascii b/src/How_to_Uninterest_Me_in_Your_Job_Opening.ascii new file mode 100644 index 0000000..630b54f --- /dev/null +++ b/src/How_to_Uninterest_Me_in_Your_Job_Opening.ascii @@ -0,0 +1,87 @@ +How to Uninterest Me in Your Job Opening +======================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have been recieving an incredible amount of job calls and emails lately. I +mean, so many that I'm concerned my cell phone minutes will go over my alotted +450 (sure, I don't have to answer those calls). For whatever reason, I actually +read through most of these emails. However, lately my brain has been tuning its +spam filters to reduce the strain of going through that much junk. For you head +hunters out there, here is my personal list of easy ways to uninterest me in +your job opening. You might want to pay attention because I suspect I speak for +a lot of people. + +1. Using words like **URGENT**, **NEED**, **ASAP**, and/or *OPPORTUNITY* ++ +This will not make me want to answer your email any faster. It will, in fact, +make me sad to see an email from you and not want to do business with you ever. + +2. Writing subject lines all or mostly in caps ++ +Your excessive use of caps lock will only deter me from reading your email. All +caps says to me "no one is interested in this job for a good reason so I will +resort to doing whatever I can to make sure that people read the subject of +this email". + +3. Telling me there is a need for a <job title> in my area ++ +You see, now it just looks like you're spamming me using key words from my +website. If you have a job in my area, tell me what the job is and who it's for +- not that there is one. + +4. Describing in the job requriements that I must be able to "operate well + within time constraints and be able to multi-task in a fast-paced + environment" ++ +I understand there are some exceptions to this but most jobs require this. In +fact, I can't remember a single recruiter email yet that hasn't mentioned this. + +5. Use the words "fast-paced environment" ++ +This one is almost a sure fire way of getting me to delete your email in a +fast-paced way. I have had really bad experiences with this one. I'm sure you +mean well and intend this to say "__dynamic changing environment__", but to me +this says "__lots and lots of unpaid overtime__". + +6. Make it clear to me that you found me only on a few keywords on my resume + and offer me a job that is not even remotely close to what I do. ++ +Just because the keyword _Java_ is in "Java Application Administrator" on my +resume doesn't mean I'm a "Java programmer". + +7. Offer a 3 to 4 month contract in another state where the cost of living is + far higher than where I am now ++ +Does anyone ever take these? I just don't see a reason to move to another state +for "3 to 4 months" other than just wanting to visit that state. + +8. A job regarding ways to make SuperUberplexes of moneys from home working + only a small number of hours per week ++ +Call me closed minded but I view these as either pyramid schemes or +get-rich-quick schemes. I've seen many of these and they either land people in +jail or fizzle out with little to no consequence or profit. + +9. Call or email me when you clearly know only a small amount of English ++ +What do you think outsourcing your recruiters says to me? If I ask a very +simple question and it is not understood, not because I didn't phrase it right +but because the recruiter doesn't know the words, I will not be very interested +in your job opening or company. + +10. Send me an email that is obviously a generated template ++ +The sentence "Our records show that you are an experienced IT professional with +experience In . Net Developer This experience is relevant to one of my current +openings. <Paste opening title from website here>" is clearly generated. +Firstly, the word *in* should not be capitalized In the middle of a sentence, +even if In a title. Also, it's **.Net**, not **. Net**. Additionally, you +missed a period. Most likely when you copied and pasted the job title in your +sentence you overwrote the period at the end. + + +// vim: set syntax=asciidoc: diff --git a/src/Hyper-V_and_Vista.ascii b/src/Hyper-V_and_Vista.ascii new file mode 100644 index 0000000..b4728ff --- /dev/null +++ b/src/Hyper-V_and_Vista.ascii @@ -0,0 +1,48 @@ +Hyper-V and Vista +================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Today I built out 8 more servers for our dev team. We have a blade server +hosting all of this with Hyper-V. Here's what my picture looks like... + +I log into my Vista work machine, use terminal services to log into the blade +and open up Hyper-V Manager. From there I connect to the machine via Hypervisor +console. + +Essentially, I have a remote window inside of a remote window. Naturally, +mouse and keyboard key sends are at less-than-desireable speeds. My hopeful +solution: Hyper-V management console on Vista. + +Over the last year or so I have been hearing talks about how one could not +install Hypervisor on Vista so naturally my hopes were already somewhat +crushed. Despite the dire situation, I started the search (thanks Google) and +much to my suprise, with Vista SP1 Microsoft released a patch +(http://support.microsoft.com/kb/952627[KB952627]) to install the Hyper-V +Console through Windows Update (thank you Microsoft). + +Here are the links (Windows authenticity check required) + +Vista x86 +http://www.microsoft.com/downloads/details.aspx?FamilyID=a46d0047-e383-4688-9449-83373226126a&displaylang=en&Hash=gUz0Srl8YL8V57oEvToZsTEga7tWBKPgtjBsGst7kRZwF96bbYMMRWbS3gQJnXWBzg24xhBYw6Zlw3ZNZ8C%2bgg%3d%3d + +Vista x64 +http://www.microsoft.com/downloads/details.aspx?FamilyID=f10e848f-289c-4e04-8786-395371f083bf&displaylang=en&Hash=AXftxujSp7eaWx3FURGL1rsoJAoqt0jtSsZfn/Ppq%2bSQXBuWEJ2010LWN8to%2b9azkVXBA/cXS3ONLqYZtBoCDA%3d%3d + +Once the management console is installed, you should be able to remotely +connect to your server with Hyper-V. + +Once again, thank you Microsoft for a very satisfying product. + + +Category:Microsoft + +Category:Windows + +Category:Virtualization + + +// vim: set syntax=asciidoc: diff --git a/src/IOHQ_Status.ascii b/src/IOHQ_Status.ascii new file mode 100644 index 0000000..930c372 --- /dev/null +++ b/src/IOHQ_Status.ascii @@ -0,0 +1,14 @@ +IOHQ Status +=========== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +=== There are currently 100 iohq posts! + +Well that wasn't as awesome as I thought it'd be. + + +// vim: set syntax=asciidoc: diff --git a/src/Install_Java_6_on_Debian_Lenny_5.0.ascii b/src/Install_Java_6_on_Debian_Lenny_5.0.ascii new file mode 100644 index 0000000..23b5d24 --- /dev/null +++ b/src/Install_Java_6_on_Debian_Lenny_5.0.ascii @@ -0,0 +1,64 @@ +Install Java 6 on Debian Lenny 5.0 +================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Despite its numerous problems and frequent needs for updates, Java is still +used for a lot of software. That sadly means it must be installed to run Java +applications. Due to the fact that Java is not open source, it classifies as a +non-free install in linux and therefore cannot be available by default due to +some legal jibberjabber (yeah, just made that up). + +Here's how it's installed on Debian Lenny. + +First off we need to modify our repository sources to search and install +non-free software. To do this, let's open 'er up in our favorite editor VIM. + +Seriously though, you're welcome to use another editor if you want to. I will +only judge you a little. :) + +---- +vim /etc/apt/sources.list +---- + +From here we need to make a few modifications. The following sources.list is +from a fresh default install of Debian. *. + +---- +# +#deb cdrom:[Debian GNU/Linux 5.0.6 _Lenny_ Official i386 NETINST Binary-1 20100905-11:24]/ lenny main +#deb cdrom:[Debian GNU/Linux 5.0.6 _Lenny_ Official i386 NETINST Binary-1 20100905-11:24]/ lenny main +deb http://ftp.us.debian.org/debian/ lenny main '''contrib non-free''' +deb-src http://ftp.us.debian.org/debian/ lenny main +deb http://security.debian.org/ lenny/updates main '''contrib non-free''' +deb-src http://security.debian.org/ lenny/updates main +deb http://volatile.debian.org/debian-volatile lenny/volatile main +deb-src http://volatile.debian.org/debian-volatile lenny/volatile main +---- + +Basically all we just did was add "contrib non-free" to the end of two +repositories. Not too bad, eh? + +Next we need to update our package manager. To do this... + +---- +apt-get update +---- + +Finally, install the Java software you need. In my case, sun-java6-jre + +---- +apt-get install sun-java6-jre +---- + +Annnnnnd away we go! + +Category:Linux +Category:Debian +Category:Java + + +// vim: set syntax=asciidoc: diff --git a/src/Installation_of_Aptana_Studio_into_Eclipse.ascii b/src/Installation_of_Aptana_Studio_into_Eclipse.ascii new file mode 100644 index 0000000..039fe28 --- /dev/null +++ b/src/Installation_of_Aptana_Studio_into_Eclipse.ascii @@ -0,0 +1,36 @@ +Installation of Aptana Studio into Eclipse +========================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Hello all, I recently attempted installing the Aptana (web dev functionality +based off of Eclipse) studio after messing up my stand-alone version (which was +outdated anyways). The installation process seemed relatively simple but upon +install, I received an ambiguous error message saying: + +---- +An error occurred while installing the items +session context was:(profile=PlatformProfile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Install, operand=null --> [R]org.eclipse.ant.ui 3.4.1.v20090901_r351, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction). +The artifact file for osgi.bundle,org.eclipse.ant.ui,3.4.1.v20090901_r351 was not found. +---- + +After searching this for a bit, I stumbled upon a bug report for Eclipse that +addressed this issue. + +https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/477944 + +The simple solution, crack open a fresh new terminal window (or one you already +have open of course) and type in **sudo apt-get install eclipse-pde**. + +Attempt reinstalling the Aptana plugin and all should go smoothly now. + + +Category:Aptana_Studio + +Category:Eclipse + + +// vim: set syntax=asciidoc: diff --git a/src/Installing_KDE_4.6_in_Debian.ascii b/src/Installing_KDE_4.6_in_Debian.ascii new file mode 100644 index 0000000..9b98137 --- /dev/null +++ b/src/Installing_KDE_4.6_in_Debian.ascii @@ -0,0 +1,54 @@ +Installing KDE 4.6 in Debian +============================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Installing KDE on Debian is a pretty simple task. Getting the latest and +greatest of KDE (or anything), is another matter especially if you want it from +a repository. + +I searched around the interwebs for some time before stumbling upon the +http://qt-kde.debian.net/[Debian QT/KDE team site]. As it turns out, +there is actually a repo for the latest of KDE, saving all of us quite a +bit of time compiling the .deb files for an entire GUI. Thankfully, +setup and installation is a breeze (thanks apt-get). First you need to +add the repo to your sources.list file. To do this, crack open your +favorite editor (mine is vi) and edit the following file + +---- +/etc/apt/source.list +---- + +Once you're in the file, add the following lines: + +---- +deb http://qt-kde.debian.net/debian experimental-snapshots main +deb-src http://qt-kde.debian.net/debian experimental-snapshots main +---- + +Save your sources.list file and run the following commands: + +---- +aptitude install pkg-kde-archive-keyring apt-get update +---- + +Finally, we install the latest version of KDE + +---- +apt-get install kde +---- + +And that's it. Add the repo to your sources.list file, get the repo key, +update, and install. Beats the pants off of compiling it yourself, huh +(especially when you're doing it on a machine like mine)? + + +Category:KDE +Category:Debian +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Installing_Team_Foundation_Server_2008.ascii b/src/Installing_Team_Foundation_Server_2008.ascii new file mode 100644 index 0000000..ae58d41 --- /dev/null +++ b/src/Installing_Team_Foundation_Server_2008.ascii @@ -0,0 +1,183 @@ +Installing Team Foundation Server 2008 +====================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +The installation of TFS 2008 can be a daunting task if the right documentation +is not used. This post will cover the installation of Team Foundation Server +2008 and all of its prerequisites. + +To preface, this post will document a *installation of Team Foundation Server +2008 on a Windows Server 2008 server using SQL 2008 on the backend. + +Here’s the quick rundown of what will be done. + +* Install IIS 7.0 +* Install SQL Server 2008 +* Install SharePoint +* Install Team Foundation Server 2008 + +Before the install of Team Foundation Server you must have service pack one +integrated into your install media. Microsoft has outlined how to integrate SP1 +into your install media http://support.microsoft.com/kb/969985[here]. + +To save text space on each installation process, I will be simply saying where +to go to install the specified software rather than doing a step-by-step +tutorial. Lets get started + + +[[installation-of-iis-7.0]] +Installation of IIS 7.0 +----------------------- + +Here’s a good one. To install this one, head to the Server Manager window. From +there, go to install the IIS 7.0 *Role* (it is called *Web Server (IIS)* in the +wizard). When you select it to be installed, you will be prompted to install +two more features additionally, assuming this is a clean install. Accept the +install of the two additional features and continue. The role services that +need to be installed are: + +* HTTP Redirection +* ASP.Net (Add required role services as well) +* IIS 6 Management Compatibility + +Click through the windows until IIS 7.0 is installed. Though it is not +required, I always do a restart after the installation of a new role or +service, just to be safe. + + +[[installation-of-sql-server-2008]] +Installation of SQL Server 2008 +------------------------------- + +Yet another exciting step (like every step in this process) is the installation +of SQL Server 2008. Insert the DVD (or mount the iso) and run the setup.exe on +the disk. Select the *New SQL Server stand-alone installation or add features +to an existing installation* option under the Installation page. Enter your +license key on the window that comes up and proceed through the various +prompting windows until you get to the Feature Selection screen. The features +that need to be installed are: + +1. Database Engine Services +2. Full-Text search +3. Analysis Services +4. Reporting Services +5. Management Tools – Basic + +For the Instance Configuration, the Named instance field can be anything. I +personally use the default instance and Instance ID for simplicity. For Server +Configuration I used the NT AUTHORITYNETWORK SERVICE “account” for all of the +services. Also make sure that SQL Server Agent starts up automatically and not +manually. The other three should be automatic startup by default. + +On the Database Engine page the Microsoft documentation suggests Windows +Authentication. I believe that that method for authentication has it’s purposes +but for my purposes, I use *Mixed Mode* authentication. Don’t forget to add the +user(s) you want to have sysadmin access to your SQL instance. If you forget +this step, you won’t be able to get into your instance unless you find a way to +enable the SQL SA account without having to authenticate. + +Add the users you want to have access to the analysis services on the Analysis +Services Configuration page and continue. For the Reporting Services +Configuration page, select to **Install, but do not configure the report +server**. The Team Foundation Installer will do this for you later. + +For the last few pages, just click through them (make sure to check if you want +Microsoft to receive usage reports from your instance). Review your install to +make sure everything is as it should be and install SQL server. + +Popcorn anyone? + + +[[installation-of-sharepoint-products-and-technologies]] +Installation of SharePoint Products and Technologies +---------------------------------------------------- + +Before the installation of SharePoint, we need to do a prerequisite install. +Head to the Server Manager and add the .NET Framework 3.0 feature. On my server +instance, this was actually already installed so I didn’t need to install it. +Simply make sure that you have it installed or you will run into problems later +on. Now, for the installation of SharePoint Products and Technologies. Head to +the appropriate link to download download Windows SharePoint Services 3.0 with +Service Pack 2. *x86* +http://www.microsoft.com/downloads/details.aspx?familyid=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en +http://www.microsoft.com/downloads/details.aspx?familyid=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en + +Run the SharePoint.exe file to get started with the installation. After +accepting the license agreement, we find ourselves at a fork in the road. +Select *Advanced* to do a customized install. The server type should be **Web +Front End**. On the Feedback tab decide whether or not to share usage reports +with Microsoft. Click **Install Now**. After the installation has completed, +Make sure the *Run the SharePoint Products and Technologies Configuration +Wizard now* is checked and click **Close**. + +In the Configuration Wizard, Select *No, I want to create a new server farm* +and click **Next**. For Database server type the name your database is hosted +on. In the case of a single-server install of TFS, this will be the hostname of +the server that you are installing SharePoint on. + +Choose the name of the SharePoint database or leave it default (I used +default). Input the username and password for the service account (can be the +TFSService account) and click **Next**. On the next page, be sure to remember +the port you choose for your Central Administration web application. It can be +recovered relatively easily but it’s just best to remember now. Select *NTLM* +and click **Next**. Review your settings and finalize the install. Finally, we +need to run a few command line commands. Open a command prompt as admin and +navigate to **C:\Program Files\Common Files\Microsoft Shared\Web Server +Extensions\12\bin**. First, run *stsadm.exe -o extendvs -exclusivelyusentlm +-url <nowiki>http://<ThisServersName>:80</nowiki> -ownerlogin DomainUsername1 +-owneremail "admin@localhost" -sitetemplate sts -description "Default Web +Site"* DomainUsername1 should be the account you want to have admin privileges +on the port 80 SharePoint web application. I used mixed authentication so I +gave this the service account for TFS and SQL. Next, run + +'''stsadm.exe -o siteowner -url http://<ThisServersName>:80 -secondarylogin +DomainUsername2 '''In this case, DomainUsername2 represents the user you want +to be your secondary administrator for your SharePoint port 80 web application. + + +[[installation-of-team-foundation-server-2008]] +Installation of Team Foundation Server 2008 +------------------------------------------- + +Welcome to the final step in this installation process (TFS 2008 configuration +will be in a different post). I won’t slow us down with any detailed intros. +With that, let’s get started. Insert your installation medium (once again, I +used an iso mounted through Hyper-V). Start up the installation, agree to the +TOS (if you actually do) and head on to the next screen. After clicking Next a +few times, you’ll find yourself at the *Team Foundation Database Server* page. +As I mentioned earlier in the post, I’m doing a single server install this time +which means my TFS database is hosted on a local instance of SQL. The installer +should fill out the local server name for you. Since we’re doing a single +server install, click **Next**. Sit back and relax for a few minutes while the +installer runs a **System Health Check**. Once the health check is complete, +click '''Next '''to head to the *Team Foundation Server Service Account* +screen. Once there, specify the account you want TFS to run as. In my case I +chose a domain account for access reasons. Click **Next**. On the Reporting +Services Data Source Account screen, input the information for the account you +want TFS to run reports as. In my case, I elected to go with '''Use Team +Foundation Server service account '''since my SQL reporting runs as that user. +Click **Next**. The installer should automatically fill in the information for +you on the *Windows SharePoint Services* screen. In my case though, the Central +Administration URL was incorrect for some reason (the port was one number off) +so make sure that everything is right before continuing. Click **Next**. Here +we are at the *Specify Alert Settings* page. If you wish TFS to notify you (or +anyone else) of various build events (this is configurable), check the *Enable +Team Foundation Alerts* checkbox and fill in the information for *SMTP server* +and '''From e-mail address '''fields. Click **Next**. On the *Ready to Install* +page, review your settings. If everything is correct, click **Install**. + +There you have it... a fresh install of Team Foundation Server 2008. + + +Category:Microsoft + +Category:Team_Foundation_Server + +Category:Visual_Studio + + +// vim: set syntax=asciidoc: diff --git a/src/Installing_Team_Foundation_Server_2010_Beta_1.ascii b/src/Installing_Team_Foundation_Server_2010_Beta_1.ascii new file mode 100644 index 0000000..a98e594 --- /dev/null +++ b/src/Installing_Team_Foundation_Server_2010_Beta_1.ascii @@ -0,0 +1,200 @@ +Installing Team Foundation Server 2010 Beta 1 +============================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + +The installation of Microsoft's latest beta release of Team Foundation Server +2010 has apparently been quite a hot topic in IT lately. My Twitter page isn't +that popular and when I first started tweeting my progress, shortly after I was +receiving messages regarding my documentation and progress. Here is the shortly +awaited documentation on what I've done to install TFS. + +Here's what my environment looks/will look like: + +* Windows Server 2008 Enterprise (with hyper-v but that's irrelevant) +* SQL Server 2008 Standard +* WSS 3.0 +* Sharepoint 2007 Enterprise +* Team Foundation Server 2010 Beta 1 (of course) + +There are a few ways this environment can be changed around (which versions +such as Enterprise or Standard can be used). Check out Microsoft's TFS +installation documentation for this information (a convenient .chm file...check +my blog post on this if you have issues opening this file). + +Additionally, _this post documents a single-server installation on a +64-bit machine_. + +Here's a summary of the order of software installation that will be taking +place. + +* Windows Server 2008 (we have to have an operating system) +* IIS 7 +* SQL Server 2008 +* Team Foundation Server 2010 Beta 1 (with WSS 3.0) + +If it isn't obvious yet, this is going to be a long post. I've taken +screenshots of many of the steps which won't help the length. Is everyone +buckled in? Good. Let's get started. + + +[[installing-windows-server-2008]] +Installing Windows Server 2008 +------------------------------ + +The install of Windows Server really isn't that complicated. There are not +special requirements for this. However, post-install, my server was added to a +domain so I could use domain service accounts. It isn't necessary to have the +server added to a domain though. + +[[installing-iis-7.0]] +Installing IIS 7.0 +------------------ + +This part really isn't too bad (thankfully). In the server management, on the +left click **Roles**. On the right, click **Add Role Services**. + +image:IIS_01_Add_Role.jpg[height=300] + +image:IIS_02_Role_Services.jpg[height=300] + +Here some default values are selected. You need to add **HTTP Redirection**, +**ASP.Net**, **Windows Authentication**, and *IIS 6 Management Compatibility* +and all subordinate check boxes. Click **Next**. + +Here your selections are reviewed. If everything is correct, click **Install**. +Once the install has completed, you'll see another review window. If everything +was successful, click **Close**. + + +[[installing-sql-server-2008]] +Installing SQL Server 2008 +-------------------------- + +Here's where the real fun begins. This install isn't too bad. The real ticket +is to know if you have any service accounts you want to use for the SQL +services. Since I did a single-server install on a server dedicated to my team, +I used NT Authority/Network Service for mostly everything, but I'll get to that +a little later. + +First off, insert the SQL installation media (I used an ISO file mounted +through Hyper-V for mine). + +From here, run the setup executable on the disk. Mine did an autorun. From +that window, I selected **installation**on the left navigation pane. On the +screen that loads on the right, select **New SQL Server stand-alone +installation or add features to an existing installation**. + +The screen that comes up will run five tests. If your installation is clean +than most likely all five will pass with a green check mark. Mine threw a +warning to me on Windows Firewall because mine was turned on with default +settings. Since the server is behind two firewalls, I elected to disable the +Windows firewall completely. Re-running the test after that resolved the +warning. Click **Okay**. + +Here we are at the obligatory Product Key screen. Enter your product key and +hit **Next**. + +If you accept the license terms (License Terms page), check the box and click +**Next**. + +The next screen wants to install setup support files. Go ahead and click +*Install* to continue. The following screen will yet again, run some more tests +(eleven to be precise). Again, if this is a clean install, every test should +pass. + +Here's one of the crucial screens: *. On this screen, you should select to +install *Database Engine Services* (for TFS), *Full Text search* (for +reporting), *Reporting Services* (for reporting), **Analysis Services**, +**Client Tools Connectivity**, and **Management Tools Basic**. Once those are +checked, click **Next**. + +image:SQL_03_Instance_Configuration.jpg[height=300] + +Hit *Next* to continue to the * screen. If you want to, you can rename this SQL +instance to whatever you want it to be. I chose the default MSSQLSERVER since +it will be used for TFS only and nothing else will be connecting to it. Click +**Next**. + +Click *Next* on the *screen. + +Here we are at the Server Configuration section. Unless you have any specific +domain accounts set up for running SQL, NT AUTHORITYNetwork Service will +suffice for all of the accounts listed. No password is required to use this +username. Also be sure to change *SQL Server Agent* to start up automatically +(by default it is manual). Click **Next**. + +The Microsoft documentation suggests on the Database Engine Configuration page +that Windows authentication mode be checked. I have had some pretty nasty +experiences with this in the past and selected **Mixed mode authentication**. +Following this, you need to type in a password for the SQLSA user. Also, don't +forget to add all of the users you want to have access to the DB engine. Once +you're done with that, click next. + +The next page is the Analysis Services Configuration page. Add any users you +want to have access to the analysis services that your SQL instance will +supply. Click **Next**. + +On the Reporting Services Configuration page, select **Install the native mode +default configuration**. Click **Next**. + +Here's the obligatory Error and Usage Reporting screen. Check whether or not +you want Microsoft to receive anonymous usage statistics regarding your SQL +instance and click **Next**. + +Nearing the end, click *Next* on the Installation Rules screen. + +*Finally* + +Once the installation is complete, click *Next* and **Close**. + + +[[installing-team-foundation-server-2010-beta-1]] +Installing Team Foundation Server 2010 Beta 1 +--------------------------------------------- + +Here we are at the final software install. This part really isn't too bad +(surprisingly enough). + +To begin, insert the installation media (once again, I mounted an ISO through +Hyper-V). If autorun is enabled, a standard window should come up giving you +the option to explore the newly inserted media. If this does not happen, just +open up Computer and navigate to the disk. + +Inside the disk there are three folders. Depending on your processor +architecture, choose either the TFS-x64 or TFS-x86 folders. From within that +folder, run the Setup.exe file. + +Here we're at the first screen. Click *Next* to proceed. + +Once again, the ever-present Licensing Terms page. If you accept, check the box +and hit **Next**. + +image:TFS_02_Features_to_Install.jpg[height=300] + +The Microsoft documentation suggests that only Team Foundation Server be +checked. I actually need the build server to be on the Team Foundation Server +as well so I checked all three. Either will work though. **Click Install**. + +image:TFS_04_MidInstall_Restart.jpg[height=300] + +During your installation, the server will need to be restarted. Click restart +now. Upon restart, the configuration option will become available to you. + +Pat yourself on the back. You just installed TFS. This is a long enough blog +post for now. I'll post here very shortly the configuration steps I took for +TFS (still haven't taken all of the screenshots I need for it). + +Thanks for reading. + +Dirk + + +Category:Microsoft + +Category:Team_Foundation_Server + +Category:MsSQL Category:IIS + + +// vim: set syntax=asciidoc: diff --git a/src/Installing_Visual_Studio_2008_Service_Pack_1.ascii b/src/Installing_Visual_Studio_2008_Service_Pack_1.ascii new file mode 100644 index 0000000..aad0156 --- /dev/null +++ b/src/Installing_Visual_Studio_2008_Service_Pack_1.ascii @@ -0,0 +1,43 @@ +Installing Visual Studio 2008 Service Pack 1 +============================================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Recently, I realized that a few of our developement servers were running Visual +Studio 2008 with the beta of SP1. One would assume that the installation of a +service pack wouldn't be too difficult but since they already had the beta of +service pack 1 installed, the installation of SP1 became a bit more +complicated. + +If you download the service pack installation file from Microsoft and run it, +you get an error saying that you need to run the Service Pack Preparation Tool +before being able to install. Head to the Microsoft website and download the +removal tool. + +http://www.microsoft.com/downloads/details.aspx?FamilyId=A494B0E0-EB07-4FF1-A21C-A4663E456D9D&displaylang=en#AffinityDownloads + +In my case, I ran the SP prep tool and received yet another error. It said that +it need some files on the installation disk for **Visual Studio 2008 Shell +(integrated mode) ENU**. The ticket here is that we don't have a disk for that +and to my knowledge, there isn't one. Microsoft has a download for it but it's +an executable that doesn't extract an iso. I searched around for a solution to +the problem and found a site that said to simply uninstall *VS 2008 Shell* +(listed in Programs and Features as Microsoft Visual Studio 2008 Shell...). I +performed said action and the prep tool ran fine with no errors. + +After running the prep tool, I simply ran the installer for the service pack +with yet again no errors. + +The install did, however, take about two hours (ugh). + +There you have it. + + +Category:Microsoft +Category:Visual_Studio + + +// vim: set syntax=asciidoc: diff --git a/src/Kill_All_Connections_to_SQL_Database.ascii b/src/Kill_All_Connections_to_SQL_Database.ascii new file mode 100644 index 0000000..130147a --- /dev/null +++ b/src/Kill_All_Connections_to_SQL_Database.ascii @@ -0,0 +1,38 @@ +Kill All Connections to SQL Database +==================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently had to help one of our testers test an application. One of the tests +to perform was to see how the web application handled losing its connection to +the database in the middle of various operations. + +My first thought on how to do this was to simply take the database offline +during a session. Unfortunately however, SQL Server Management Studio won't +kill current connections when this operation is attempted, rather it will error +out. + +After searching around I found a query that in essence kills all connections to +the database but one (single-user mode). + +*The query for this.* + +---- +-QUERY NUMERO UNO +ALTER DATABASE [DATABASE-NAME] SET SINGLE_USER WITH ROLLBACK IMMEDIATE +-And let's put this DB back in multi-user mode +ALTER DATABASE [DATABASE-NAME] SET MULTI_USER +---- + +In this query, database-name is switched to single_user mode. The second query +sets the database back to multi_user mode. + +Ah such simplicity. + +Category:MySQL + + +// vim: set syntax=asciidoc: diff --git a/src/Let's_get_started..._again.ascii b/src/Let's_get_started..._again.ascii new file mode 100644 index 0000000..605d866 --- /dev/null +++ b/src/Let's_get_started..._again.ascii @@ -0,0 +1,35 @@ +Let's Get Started... Again +======================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Hi everyone, For those of you who don't know me, I'm the author of the +http://bitnode.net/category/musings-of-a-systems-admin/[Musings of a Systems +Admin] blog where I discussed many various areas relating to server security, +troubleshooting, and the building and configuration of servers for Microsoft +SharePoint, MSSQL, Microsoft Hyper-V, Windows Server 2008, Team Foundation +Server 2010 and 2008, and various other server technologies out there. + +Judging from the title of this blog you have no doubt guessed that the +aforementioned Microsoft ship has sailed and we're now boarding another +exciting one for more adventures into the vast world of technology. It almost +makes it sound like it'll be fun. Have no worries though, I will try to do my +best to make these posts as painless but helpful as possible via the use of +clever buzzwords (get out your buzzword bingo cards), an xkcd.com comic here +and there, and vivid imagery and screenshots to depict the dull and grey world +of programming...alright, it's not THAT boring, or is that just me? + +Here's to the hopefully painless, informational, and entertaining journey +ahead. + +Additionally, here's to Ric who aptly dubbed me Timex. + +Cheers + +Timex + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:At_the_Office.ascii b/src/Linux:At_the_Office.ascii new file mode 100644 index 0000000..b9d5c69 --- /dev/null +++ b/src/Linux:At_the_Office.ascii @@ -0,0 +1,228 @@ +Linux:At the Office +=================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have been running Linux on my laptop at home for the last four-ish years now +and it's given me very little trouble. Mostly it's just been the growing pains +of each of the projects. I just recently started running Linux on my laptop at +work as well (if you manage Linux servers, why not use Linux to do it). +Inevitably, the question has been asked numerous times "what open source Linux +software out there can do this thing I need to do?" Usually when I start +researching that though, I find myself wishing to know what everyone else uses +and there just doesn't seem to be a lot of blog posts on that. That said, here +we go. + +The things I do in my day usually entail the following + + +[[email]] +== Email + +Awwww yeah. This one is everyone's favorite topic I'm pretty sure. I recently +read an article about how one of the greatest deficiencies of Linux is its lack +of really solid mail clients. This is true to a certain extent. While Linux has +a couple of pretty solid mail clients, +http://projects.gnome.org/evolution/[Evolution] and +http://www.kde.org/applications/internet/kmail/[KMail], they both still lack +reliable Exchange support. Evolution has an Exchange mapi plugin, but it was +pretty buggy for me. It also has support for Exchange EWS, but your exchange +web services need to be set up correctly for that to work. + +The solution I found here, after an unfortunate amount of time hunting around, +is called http://davmail.sourceforge.net/[DavMail]. I have to say that this +little piece of software is really great. Exchange basically provides three +main pieces of functionality: email, calendar syncing, and Active Directory +address book searching and syncing. All three of these pieces have open source +equivelants: IMAP+, CalDav, and CardDav. What DavMail does is connect to the +Exchange server and provide a local server for each of these services. With +this you need not make any wonky changes to your mail client or use any +unstable plugins. You simply use what's already tried and true (and open source +if that's important to you): IMAP, CalDav, and CardDav. + + +[[vpn]] +== VPN + +My company uses two VPNs at present because we are <span +style="text-decoration:line-through">stuck</span> in the middle of a transition +from one to the other. That unfortunately means that I need two VPN clients. +Thankfully though, the open source folks have come through on yet another +awesome competitor to a proprietary alternative. The first VPN client I use is +called http://www.unix-ag.uni-kl.de/~massar/vpnc/[vpnc]. This one is for +Cisco's standard VPN server. The other client I use is called +http://www.infradead.org/openconnect/[openconnect]. This one is for interfacing +with Cisco's AnyConnect. + + +[[internet-browsing]] +== Internet Browsing + +This one took me a little bit to get sorted out. Don't get me wrong - I like +Firefox. It's just a really heavy browser. It takes a very long time to come up +from a cold boot and also takes a lot of RAM while it's running. Understandably +so though, that browser does just about everything. To sum it up now so you +don't have to read the rest of my ramblings on this particular topic, I ended +up using https://mozilla.org[Firefox]. + +Now, to cover the reason why... I really like the +http://surf.suckless.org/[surf] browser (this browser is so tiny you can easily +count its size using kilobytes) as well as http://midori-browser.org/[Midori] +(a clean and small apparent [from the ui] fork of chromium), but they both lack +something one really needs working in a big corporation - Microsoft's NTLM +authentication. If I try to log in to any SharePoint site, I am immediately +sent to a 401 error page (not authorized) without even being presented with a +login box. Firefox, however, has NTLM built in so that's the one I use now. + + +[[programmingdevelopment-environment]] +== Programming/Development Environment + +Almost every day I'm writing a script or program of some sort in Perl, C\+\+, +PHP, bash, or ksh. All of this programming occurs in http://www.vim.org/[vim]. +I won't lie, I heart vim. There's not much more to say here. + +If you don't know vim but are interested in learning, I highly recommend it. If +you think keyboard shortcuts aren't worth the time they can save you, just move +along. If however you are in that group but are still interested in command +line editing (it does have its perks after all), +http://www.nano-editor.org/[Nano] is a good option for you. Otherwise in the +realms of guis, I'd say http://bluefish.openoffice.nl/index.html[Bluefish] is a +good option and http://tarot.freeshell.org/leafpad/[Leafpad] is a good one +(albeit very basic) for you minimalist folks. + + +[[general-office-authoring]] +== General Office Authoring + +This means Word documents and Excel spreadsheets. I use +http://www.libreoffice.org/[LibreOffice] for this. In this category, we've got +some pros, but we definitely have some cons. + +The pros are all pretty obvious here. A mostly fully functional office +authoring suite, nearly equivelant to a multi-hundred dollar suite of software +is a pretty big pro, especially since it works almost flawlessly with +Microsoft's formats. However, on the side of the cons (Kaaahhhhhnnnn!!!), we've +got a few. Some of the more advanced and less used features of MS Word are not +yet implemented, or not implemented in the same way in LibreOffice Writer. The +biggest impact for me though is LibreOffice Calc. It's biggest defficiency in +my experience is macros. It turns out that it uses a completely different +macro language/syntax than MS Excel. This means that chances are, those +drop-down cells that change your spreadsheet won't work at all. This is very +problematic when your company publishes metrics using fancy Excel spreadsheets +with hundreds of kilobytes of macros. + + +[[documentation]] +== Documentation + +I use two products, one because of superiority (in my opinion), and one out of +necessity. The necessity is LibreOffice Writer, which is required because every +big company seems to use SharePoint shared documents to do documentation, +despite it's poor design, hungry indexer, and a versioning system that's less +functional than adding the modification date to the document filename. + +Out of superiority though (again, my opinion), I use a wiki for documentation. +Specifically http://www.mediawiki.org/wiki/MediaWiki[MediaWiki], though there +are many other solutions out there. This enables my team to work +collaboratively on their documentation. It's easily indexed and searched as it +is stored in plain text. The markup is easy, and you don't have to fight with a +http://en.wikipedia.org/wiki/WYSIWYG[wysiwyg] editor wrongly auto-formatting +much of what you do. For a bigger compare and contrast of SharePoint and +MediaWiki, I wrote link:MediaWiki_vs_SharePoint[a post] about this a ways back. + + +[[versioning-work]] +== Versioning Work + +This one isn't really something that's super applicable for most people I +suspect. For versioning my files though, I have lots and lots of git repos. I +have one for versioning all the documents I write/modify [because SharePoint's +versioning is awful], and I have one repo per script that I write with all of +my remotes pointing to bare repos sitting on one of our backed up servers. I +readily admit this isn't the easiest way to do it for most folks, but for me, a +git fanboy and engineer, git is by far the best [that I know of] and most fun +way to do this for me. If I didn't have to do Word documents for documentation +though, I would happily rely on MediaWiki's versioning functionality for all of +my documentation needs (sounds a little like a commercial). + + +[[bmc-remedy]] +== BMC Remedy + +Nope, not going to link to it - it's not worth that much dignity. However, if +you are unfortunate enough to have to deal with this software, it installs +nicely in wine and in fact runs better on Linux than on Windows (oddly). + +Going back to the insult I just threw BMC's way, don't get me wrong, this +software is neat. It does a good job tracking piles of metadata for ticket +tracking. However, I have several reasons for disliking it so much. It's a +super huge bandwidth sucker (go ahead, turn on tcpdump and watch what it does +when you perform any action). It's also unbelievably slow (here's the bandwidth +thing again) and is completely dependant on Internet Explorer 6 or greater, +rather than being its own piece of independant software. Additionally, it's +buggy and it's missing all kinds of interface conveniences that one would +expect in something so robust and expensive. Here's to Service Now being a +better product than its predecessor (I hope). + + +[[connecting-to-windowssmb-shares]] +== Connecting to Windows/SMB Shares + +I've had problems with this in the past in Linux land. For whatever reason, SMB +share integration into file managers (thunar, nautilus, etc) has been pretty +slow and buggy. However, if you have root access to your laptop, you can use +http://www.samba.org/samba/docs/man/manpages-3/mount.cifs.8.html[mount.cifs] to +mount the SMB share locally and that has yet to fail me. It's fast and stable, +AND you can add it to your system's fstab. If you want to try SMB shares in +your file manager though, install your distro's _gvfs_ and _gvfs-smb_ packags +and close all of your file managers to reload things. + + +[[transferring-files-from-nix-to-nix]] +== Transferring Files From Nix to Nix + +This one is one of my favorites. The people surrounding the openssh project are +truly geniuses in my mind. A lot of people transfer files from one Linux system +to another by using scp to download the file to their local machine, and then +use SCP to transfer that file from their local machine to the destination +server. Depending on how things are set up, you may be able to scp files +straight from server to server. + +There's this really neat thing out there called +http://fuse.sourceforge.net/sshfs.html[sshfs]. Sshfs allows you to mount a +remote filesystem locally...over SSH. There is no additional software +installation or configuration required on your server other than having ssh +installed and running. You can mount these filesystems and drag and drop files +all over the place. It's a pretty great piece of sofware I do say so myself, +and very stable too. + +Now, I typically use scp to transfer my files anyway. Where sshfs really comes +in handy is when I need to work on remote files such as Word documents or Excel +spreadsheets that are stored on the remote system. With sshfs I can mount the +remote share locally and work "directly" on the files without having to scp +them locally, work on it, save changes, and scp it back to the server. + + +[[microsoft-office-communicator]] +== Microsoft Office Communicator + +This one is a sensitive topic for a lot of people. Most of the people I know +don't like MOC. Granted, most of the time that's because it's not set up right, +not because the product itself is bad. + +To connect to a MOC server from Linux land, we need +http://www.pidgin.im/[Pidgin] and a plugin for it called +http://sipe.sourceforge.net/[Sipe]. With these two, you should be able to +connect to the communicator server, send and receive messages, send and receive +files, share desktops, and search Active Directory for users. It's a pleasantly +functional plugin. + + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:Checking_CPU_Core_Usage.ascii b/src/Linux:Checking_CPU_Core_Usage.ascii new file mode 100644 index 0000000..edb06e8 --- /dev/null +++ b/src/Linux:Checking_CPU_Core_Usage.ascii @@ -0,0 +1,55 @@ +Linux:Checking CPU Core Usage +============================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +This is mostly for my own future reference. Today I needed to to check the +resource consumption of an application on a currently bare metal system so I +could get a good idea how to spec out its new virtual home. Now, in Linux, +checking cpu consumption is easy, but I wanted to check the _per core_ usage. +The reason in this case was no one knew if this application was multithreaded +(likely not if the application's stability is indicative of its code quality) +and how well if it was. Giving a machine multiple threads to run a single +threaded application is a bit pointless. That said, I found two ways to check +per core usage that didn't involve installing additional packages on the system +(http://hisham.hm/htop/[htop], I'm looking at you). + +[[mpstat]] +mpstat +~~~~~~ + +Mpstat is a really cool program I happened upon today in my searches. It +basically reports on every live stat you could ever want on a CPU. + +---- +mpstat -P ALL 2 10 +---- +That will report _all_ stats on all cpus every _2_ seconds, _10_ times. + + +[[top]] +top +~~~ + +I'd prefer not using something that's interractive so I can more easily use the +data with other programs (like tr, cut, grep, etc), which is why I included +this one second. With top, if you press the *1* key while it's running, it will +print per-core cpu stats. + +---- +Tasks: 188 total, 1 running, 187 sleeping, 0 stopped, 0 zombie +Cpu0 : 0.3%us, 0.0%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st +Cpu1 : 0.0%us, 0.0%sy, 0.0%ni, 97.0%id, 3.0%wa, 0.0%hi, 0.0%si, 0.0%st +Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st +Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st +Mem: 4086584k total, 3951260k used, 135324k free, 24532k buffers Swap: +8388600k total, 4203824k used, 4184776k free, 103416k cached +---- + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:Comparing_Remote_with_Local.ascii b/src/Linux:Comparing_Remote_with_Local.ascii new file mode 100644 index 0000000..c681a3a --- /dev/null +++ b/src/Linux:Comparing_Remote_with_Local.ascii @@ -0,0 +1,118 @@ +Linux:Comparing Remote with Local +================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Today I ran into quite the conundrum. I've been needing to compare the contents +of a file on a remote server with the contents of a file on my local server +over ssh. My original solution was to copy the file from one server to the +other over sftp and compare their contents with diff. + +However, when you need to compare more than just the contents of a file, things +can get really messy. Take for instance another situation where I needed to +compare the contents of a directory. First, I needed to output the contents of +a directory on BOTH servers into two files I had to create. Then I had to sftp +into one server, copy it over to the other server, and run diff to compare +their contents. Talk about complicated, yeah? + +All this copying and sftp-ing around frustrated me to the point where I wanted +to find another solution. Sadly, my solution is a bit complicated for someone +who doesn't know the linux command line super well, but at least it works and +it works fast. I'll go slowly because if I don't, I won't get it myself either. + +---- +ssh username@ServerIP 'ls -1 /tmp' | diff <(ls -1 /tmp) +---- + +Here's our example. The end result of this example is to get a comparison of +the contents of a remote /tmp directory and the contents of our local /tmp +directory. + +First things first, we have to run a command remotely to get the contents of +said remote directory. To do this, we run simply + +---- +ssh username@ServerIP 'ls -1 /tmp' +---- + +That gets a list of the files and folders in the /tmp directory. Specifically, +the '-1' switch gives us one file or folder per line. + +Next up we pipe that into the diff command. + +For those of you who may not know about this functionality, piping basically +takes the output of one command, and feeds it to another. In this case, we are +taking the listed contents of a remote directory and feeding it to the diff +command. Now, we do this by using the following. + +---- +... | diff ... +---- + +Basically, the diff command works by finding the difference between the first +thing it is given and the second thing it is given. Generally speaking, diff +works like the following. + +---- +diff <file1> <file2> +---- + +In this case we are saying diff which means to substitute what was piped in +with the -. + +Up to this point, we have the contents of our remote directory and we have run +the diff command. All we need now is to give it the second input to compare our +first to. This brings us to our final step getting the contents of a local +directory. + +This is about one of the most common linux command line functions performed. +However, due to the fact that we want to compare the contents of the directory +with the contents of another directory, things get a bit more complicated +sadly. Do accomplish this, we need to run a nested command. + +Ordinarily running ls -1 /tmp after a diff command would result in an error +rather than giving us what we want. To substitute a command for a file and so +compare the command's output, we need to encase it in <(). Our final piece of +the command should look like this. + +---- +<(ls -1 /tmp) +---- + +This completes our command. If you try to run the entire thing, you should be +asked for your password to the remote server. Upon entering your password, the +command should run as expected, comparing the files and folders in the two +directories. + +The final command again looks like this... + +---- +ssh username@ServerIP 'ls -1 /tmp' | diff <(ls -1 /tmp) +---- + +If you want to get really tricky, you can compare the contents of a +remote file and the contents of a local file. We'll take httpd.conf for +instance. + +---- +ssh username@ServerIP 'cat /etc/httpd/conf/httpd.conf' | diff <(cat /etc/httpd/conf/httpd.conf) +---- + +Hopefully that description wasn't too confusing. It's a complicated command to +run (probably the worst I have ever used actually), but with some practice, it +should become pretty easy if you understand how it works. + +Let me know if I didn't describe anything well enough and I will do my best to +help out and update the post so it is more user friendly. + +Thanks for reading! + + +Category:Linux +Category:SSH + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:Desktop_Sharing.ascii b/src/Linux:Desktop_Sharing.ascii new file mode 100644 index 0000000..521a16d --- /dev/null +++ b/src/Linux:Desktop_Sharing.ascii @@ -0,0 +1,73 @@ +Linux:Desktop Sharing +===================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +For the last several weeks, I and several others running Linux on my team have +been unable to use the third party desktop sharing service our company has +purchased. This is due to the fact that several weeks ago, we all received +updates to our system versions of Java (openjdk and icedtea), which broke their +"web" client. We still need to share desktops though on occasion for meetings, +so a solution needs to be found. Thankfully there is a pretty great solution +out there for this that handles surprisingly well: +https://en.wikipedia.org/wiki/Virtual_Network_Computing[VNC]. + +[[enter-vnc]] +== Enter VNC + +I'm not VNC's biggest fan. It's a really neat protocol, but it is often +misused. In nearly every deployment of it that I have seen, the end user didn't +tunnel through ssh, didn't enable ssl, and/or used their actual account +password to password the vnc session. If someone were particularly clever, they +could record the packets and effectively replay the vnc session and possibly +get the user's password amongst a list of other potential things. + +Now, given that we're doing desktop sharing, we can't tunnel over ssh because +that requires a user account (unless you set up an anonymous account, which is +another good option). We can however do vnc over ssl. + +To get going, we need one piece of software - +**http://www.karlrunge.com/x11vnc/[x11vnc]**. X11vnc differs from other vnc +servers in that it allows you to share display :0 rather than creating a new +virtual display (typically starting at :1). This allows you to physically be +using the display while other people watch it. Let's look at the +command/script to get this started... + +---- +#!/usr/bin/env bash +echo "Sharing desktop on 5900" x11vnc -viewonly -ssl -sslonly -passwd <password> -forever +---- + +What we have here is... + +[cols=",,,,,",options="header",] +|=============================================================== +|x11vnc |-viewonly |-ssl |-sslonly |-passwd <password> |-forever +| +|Prevents users from taking control of your display +|Makes ssl connections available +|Forces SSL to be used by all connecting clients +|Set the session password +|Don't shut the server down when a user disconnects +|=============================================================== + +A few things to note here... + +One final thing I would like to point out is that with this, you can do +clipboard sharing if the clients all support it. All the sharer has to do is +copy something and all of the clients should be able to paste it on their +computers. I've used this for several meetings now and it works great. The +biggest difficulty I've had up to this point is to get people to install VNC +clients for the first time. Once they've got that going, they typically comment +shortly after the meeting about how much faster and easier vnc is than the +service the company pays for. + + +Category:VNC +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:Symantec_VIP_Access.ascii b/src/Linux:Symantec_VIP_Access.ascii new file mode 100644 index 0000000..99808a3 --- /dev/null +++ b/src/Linux:Symantec_VIP_Access.ascii @@ -0,0 +1,32 @@ +Linux:Symantec Vip Access +========================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +If your company has a vpn and like to have the illusion of security, they may +use two-factor authentication to gain access to the vpn (as if certs weren't +good enough, we've got to use proprietary algorithms with who knows how many +backdoors. + +You may be experiencing issues with this if you're running linux. You may also +be experiencing issues if you don't want to sacrifice 40G of hard drive space +to a Windows virtual machine. If you fit into either or both of these +categories, this is the post for you. It turns out, that we can finale.lly get +Symantec VIP Access to run on Linux through wine. + +The trick... (because I don't have time to write this full post) + +---- +winetricks wsh57 +---- + +THEN run the installer. + +To be continued. It still won't generate a key or even open after this. +Installation works fine though + + +// vim: set syntax=asciidoc: diff --git a/src/Linux:Using_Bash_to_Generate_a_Wordlist.ascii b/src/Linux:Using_Bash_to_Generate_a_Wordlist.ascii new file mode 100644 index 0000000..5aa30fe --- /dev/null +++ b/src/Linux:Using_Bash_to_Generate_a_Wordlist.ascii @@ -0,0 +1,84 @@ +Linux:Using Bash to Generate a Wordlist +======================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +A few weeks ago my wife forgot her KeePass password. She can remember most of +it, but there are certain portions of it she can't quite get (looks like the +muscle memory didn't stick too well). With that, she asked me if there was a +way for me to recover the password to her KeePass database. While the chances +are slim, I figured if I could generate a pertinent wordlist, I could save a +lot of time over having http://www.openwall.com/john/[John] incrementally try +every possible password all the way up to 22 characters (Which happens to be +_3,807,783,932,766,699,862,493,193,563,344,470,016_ possibilities totalling +about _120,744 septillion years_ of crack time at 1000 hashes per second). + + +[[inline-array-expansion]] +Inline Array Expansion +~~~~~~~~~~~~~~~~~~~~~~ + +To do this, we're going to use one of bash's lesser-known functionalities: +*inline array expansion* (I don't know its official name or if it even has one, +so that's what I'm calling it). + +If you've ever looked up how to manually create a maildir directory, you've +likely seen something like this + +---- +mkdir -p ./your_dir/\{cur,new,tmp} +---- + +At runtime, bash will expand that command to three seperate commands + +* mkdir -p ./your_dir/cur +* mkdir -p ./your_dir/new +* mkdir -p ./your_dir/tmp + +Another good example of this functionality would be creating a new home +directory. + +---- +mkdir -p /home/username/\{Desktop,Documents,Downloads,Music,Pictures,Videos} +---- + +[[generating-the-wordlist]] +Generating the Wordlist +~~~~~~~~~~~~~~~~~~~~~~~ + +Applying this to generating a wordlist is very similar to creating +"arrays" of nested directories in a single command. To generate a +wordlist, we'll use the _echo_ command instead of mkdir (of course). +We'll also use varying combinations of arrays in a single line. + + +[[example]] +Example +^^^^^^^ + +Suppose the password you want to work on is something like __password1234__. +However, what we don't know is the order of the _1234_ at the end. We also +don't know if the first letter is capitalized or not, or if the actual password +uses 0's in lieu of o's, 4's in lieu of a's, or 5's in lieu of s's. Let's see +what we can do about this. + +---- +echo \{p,P}\{4,a,A}\{5,s,S}w\{0,o,O}rd\{1,2,3,4}\{1,2,3,4}\{1,2,3,4}\{1,2,3,4} > possible_passwords +---- + +That should produce a file containing roughly 13,000 words. However, due +to the way the arrays are processed, newlines are not inserted between each +possible password. To remedy this, just do a quick sed expression (or awk if +you like) + +---- +sed -i 's/ /\n/g' ./possible_passwords +---- + +With that, you now have a wordless primed and ready for use with john. + + +// vim: set syntax=asciidoc: diff --git a/src/Lucid_Lynx_Release_Date.ascii b/src/Lucid_Lynx_Release_Date.ascii new file mode 100644 index 0000000..53da0f4 --- /dev/null +++ b/src/Lucid_Lynx_Release_Date.ascii @@ -0,0 +1,32 @@ +Lucid Lynx Release Date +======================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I would like to take a few seconds to mention that in one day the latest +version of Ubuntu, 10.04 Lucid Lynx, will be released. + +In light of this event, I would like to point out a little known fact about the +versioning system for Ubuntu. + +Recently I discovered the reason for the seemingly massive jumps in numbers +from version to version on a friend's blog. Canonical releases a new version +every six months. That being said, the last version was Karmic Koala (v 9.10), +released in September of 2010. The previous version, Jaunty Jackalope (v 9.04), +was released in April of 2010. That being said, the version system is +[month].[year] of the release. A bit clever, despite the lack of subversions. + +My worry is still though what we do when we get to a version starting with X +(Xciting Xray???) or Y (Yippidy Yanky???). + +Enjoy the new and shiny distribution version everyone! + + +Category:Ubuntu +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/MPlayer:Recursively_Play_All_Files.ascii b/src/MPlayer:Recursively_Play_All_Files.ascii new file mode 100644 index 0000000..2252416 --- /dev/null +++ b/src/MPlayer:Recursively_Play_All_Files.ascii @@ -0,0 +1,75 @@ +MPlayer:Recursively Play All Files +=========== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I've researched this one before and there doesn't seem to be a real standard +for how to do this (such as a -r switch for recursive play). Granted, when in +Linux is there a standard for something that doesn't really need to be +standardized? In Linux land, there's usually a minimum of several ways to do +something right. Figuring out newer and more efficient ways of doing things is +fun! That said, I'm going to contribute http://xkcd.com/927/[my way of doing +this] to the mix. + +To do this, we are going to need a magical (ooo, shiny) bash one liner that +involves a little http://tldp.org/LDP/abs/html/process-sub.html[process +substitution] (ksh, sh, and csh users, sorry. Those shells don't support +process substitution). + +---- +mplayer -playlist <(find /path/to/music -type f -name \*.ogg) +---- + +[[what-just-happened]] +== What just happened?! + +What we just did there was perform process redirection. When you run the +**find /mnt/music -type...**, a process is started up. What the *<()* +around the command does is create a link to the output of the pid at +/dev/fd/63. A quick _ls -l_ will show us this. + +---- +[nullspoon@null music]$ ls -l <(find /path/to/music/ -name \*.ogg) +lr-x------ 1 nullspoon nullspoon 64 Jun 14 10:00 /dev/fd/63 -> pipe:[59723] +---- + +If you want to see the contents of that file, you can simply just run the find +command without anything else. If you want to see it in vim like you're editing +it, replace _mplayer -playlist_ with __vim__. This will be like running +vim +/dev/fd/63+. + +---- +vim <(find /path/to/music -type f -name \*.ogg) +---- + +Now, if you realy wanted to get crazy, you could change append to the +find command a bit to listen only to music with names that have a 7 in +them. + +---- +mplayer -playlist <(find /path/to/music/ -name \*.ogg | grep 7) +---- + +... Or sort our music backwards? + +---- +mplayer -playlist <(find /path/to/music/ -name \*.ogg | sort -r) +---- + +... Or a random sort?! + +---- +mplayer -playlist <(find /path/to/music/ -name \*.ogg | sort -R) +---- + +The last one is kind of pointless since mplayer has a *-shuffle* switch. I +guess you could combine the two and get _doubly_ shuffled music! I think Chef +Elzar would have something to say about that. "BAM!!!" + + +Category:Linux + +// vim: set syntax=asciidoc: diff --git a/src/Managing_Linux_with_Linux.ascii b/src/Managing_Linux_with_Linux.ascii new file mode 100644 index 0000000..7984ffd --- /dev/null +++ b/src/Managing_Linux_with_Linux.ascii @@ -0,0 +1,56 @@ +Managing Linux with Linux +========================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +It seems that many companies that run Unix/Linux servers don't let their admins +run Unix or Linux. I'm not going to speculate about the preferences about other +admins out there, but for myself, Windows XP, or even Windows 7 is nothing in +comparison to desktop Linux. For me, the two most frustrating things I miss +about desktop Linux while at work is transparent windows and a real Linux +terminal (sorry PuTTY and KiTTY I just have to many issues while using you). +The transparent windows I miss mostly because I write scripts just about all +day while continuing to monitor our environment. It'd just be nicer having a +full screen terminal that was semi-transparent so I could see our dashboards +without having to change windows. Sure hot keys are good, but transparency is +better. + +Anyways, I recently decided to try an experiment. I had a spare desktop laying +around at work, so I installed Linux. My team uses private keys to log in to +everything (trust me on this there is a lot of everything). We have several +passworded private keys that we use to get in to different boxes. One upside to +PuTTY and KiTTY is that they come with Pagent. Pagent basically keeps your +passworded private keys loaded in memory and tries to use them with each new +ssh session. This is nice, but how do we do this in Linux? + +The answer: ssh-agent. + +Like Pagent, the ssh-agent is a daemon that runs in the background and keeps +the keys you have added in memory. I ran into one small issue with using it +though. An ssh-agent instance is tied to a bash session. If for instance, you +try to run ssh-add on a bash session without an ssh-agent running in it, you +will receive the error + +---- +Could not open a connection to your authentication agent. +---- + +The way to fix this is to put the following line in your .bash_profile: + +---- +eval $(ssh-agent) +---- + +If you really want to get crazy, you can even put ssh-add into your \.bashrc +file. The major downside to this though is that every new bash instance will +ask for your private passwords if you have any set. + +Category:Unix +Category:Linux +Category:SSH + + +// vim: set syntax=asciidoc: diff --git a/src/Migrating_SQL_Data.ascii b/src/Migrating_SQL_Data.ascii new file mode 100644 index 0000000..7af806c --- /dev/null +++ b/src/Migrating_SQL_Data.ascii @@ -0,0 +1,110 @@ +Migrating SQL Data +================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +In my current project I have found a need to migrate data from one SQL server +to another. For those of you SQL gurus out there, you know that there are many +ways to migrate data from point A to point B in SQL, even when different +versions is involved. Here's my setup + +*Server 1:* + +* SQL Server 2005 Standard (x86) +* Windows Server 2008 (x86) + +*Server 2:* + +* SQL Server 2008 Standard (x64) +* Windows Server 2008 (x64) + +As you can tell, I'm upgrading versions *and* processor architectures. +Surprisingly enough, this didn't seem to cause any issues for me. + +Here are a few options one has to migrate SQL data between servers for those +who don't find this post too useful. + +* SQL Copy Database Wizard +* Detach, copy to new server, and reattach +* Backup database, copy backup to the new server, convert backup to a + database, attach the converted database +* Create a database mirror +* Duplicate the database structure on server two and import the data + from server 1 + +For my environment, only 1, 3, and 5 would work since the others leave more +possibility for data integrity issues during the transfer or require that the +SQL server be temporarily taken offline. I tried out a few of my options and +decided that 1, the SQL Copy Database Wizard, was the best option. It's +relatively straightforward and very efficient. + +For the last three days I have been struggling with it because of what looks +like permissions issues, though I can't be sure since all the error says is +that step 1 was the last step to run and that the job failed (give me ambiguity +or give me something else!). All that being said, I decided I needed to find a +new way to transfer the data. + +Through all of my troubleshooting I found quite a few SQL facets that I pieced +together to get what I needed. Here's how I chose to migrate my 12 databases +without too much trouble. + +image:files/01_SQL_Migration_ScriptDatabaseAs.png[height=300] + +To start, I used SQL Server's remarkable "**Script Database as**" functionality +to write out the query that creates the database, all of the columns, and all +of their constraints. For mine I just copied the script to the clipboard to +make compiling all of the scripts together much faster. To sum it up, I had SQL +generate the queries for each database I wanted to migrate and I pasted them +all into notepad so I could run them all at the same time. + +image:files/02_SQL_Select_Import_Data.png[height=300] + +After running all of the afforementioned queries to create the all of the +database structures on your destination server we're ready to start importing +data. * the database to import data to. Go to *Tasks* -> **Import Data**... + +If you haven't done this before, you should receive a "Welcome to the SQL +Server Import and Export Wizard" screen. **Next**. + +image:files/03_SQL_Import_Choose_DataSource.png[height=300] + +Here we are at the "Choose a Data Source" screen. For Server name type the +hostname of the server you need to migrate from (the source server). After +that, select the database you want to copy to the new server. Once done with +that, * **Next**. + +On the "Choose a Destination" screen, type in the name of the server to migrate +the data to. Next, select the Database you want to copy the data to (this +should corrospond to the DB name on the source server since we ran the create +queries generated by SQL). In my case, I was running the Import and Export +Wizard from the server I was importing the data to so SQL server already had +the Server name and Database filled out. **Next**. + +In my case, I wanted to copy the entire database to the destination server, so +for the "Specify Table Copy or Query" screen, I elected to "Copy data from one +or more tables or views". **Next**. On the following screen, check all the +database tables you want to be copied (or just check the box at the top left +for all of them). + +Nearing the end the "Save and Run Package" screen comes up. If you don't need +to save the package to be run later or again at a later time, just leave Run +immediately checked and click **Next**. Finally we review our settings and what +will be copied. If everything looks right, click Finish. Once the transfers +have completed, click **Close**. If any transfers failed or threw a warning, +you can click the "Messages" text next to the table that did not succeed to see +the log entries about it. + +Repeat the aforementioned steps until you have migrated every database you +need. + + + +Category:Microsoft + +Category:MsSQL + + +// vim: set syntax=asciidoc: diff --git a/src/Mounting_Drives_in_Linux_Without_Root.ascii b/src/Mounting_Drives_in_Linux_Without_Root.ascii new file mode 100644 index 0000000..9aa2d9a --- /dev/null +++ b/src/Mounting_Drives_in_Linux_Without_Root.ascii @@ -0,0 +1,50 @@ +Mounting Drives in Linux without Root +===================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently took an interest in building my own debian box that was roughly +equivelant to Linux Mint or Ubuntu. More specifically, I wanted a system built +from a bare bones Debian base, but had all the functionality that was offered +by the more major "end user" distributions. I wanted features such as media +capabilities (video, DVDs, and music), surfing the internet, editing photos, +etc. + +As I used my system, I took note of what else I needed to add to it to make it +more laptop friendly. One of the things it was missing was the ability to mount +external storage devices (usb sticks for the most part) without being root. +After many days of frustration, I finally caved and started making custom +adjustments outside of simply installing software. Here is how you mount an +external storage device in Debian Linux without needing root permissions. + +It is really quite simple... + +First, you need to configure the permissions on your mount location. In Debian +Linux, this location is /media. The permissions on that directory are set by +default to 744. When we mount an external device, we want a directory to be +created in there to give mount a location to mount to. In light of this, we +need the permissions on the /media directory to be 777. To achieve this, open +your root cli and run the following command: + +---- +chmod -R 777 /media +---- + +And you should now be done! + +For me however, I experienced a small problem with this. In my /etc/fstab file, +there was an entry for a cdrom located at sdb1 there. Since that is not where +my cdrom is located, I just commented out that line, and all worked as +expected. + +Just one more step towards the perfect Linux system. + + + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Non-Root_User_Connect_to_Wifi_in_Arch_Linux_with_SLiM.ascii b/src/Non-Root_User_Connect_to_Wifi_in_Arch_Linux_with_SLiM.ascii new file mode 100644 index 0000000..346c86c --- /dev/null +++ b/src/Non-Root_User_Connect_to_Wifi_in_Arch_Linux_with_SLiM.ascii @@ -0,0 +1,44 @@ +Non-Root User Connect to Wifi in Arch Linux with SLiM +===================================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I'm a fan of Arch Linux. A big reason for that (for me at least) is that Arch +doesn't do everything for you. For the most part, I'm a self-taught Linux user, +so the more things that aren't done for me, the better. In that light, I of +course have discovered yet another thing that has not been done for me like it +was in Debian (not knocking Debian at all that's still my server distro). That +would be the .xinit file for my user. Consequently, since my .xinit file is +custom made, it is obviously lacking certain handy tricks for increased +functionality. In this case, non-root wifi connections. + +To be able to run [some additional] privileged commands as your non-root user +without sudo, we need to have a package installed called +**http://www.freedesktop.org/wiki/Software/ConsoleKit[consolekit]**. When we +use this to launch our X interface, it gives our GUI applications permissions +to do more stuff +(http://theportalwiki.com/wiki/Cave_Johnson_voice_lines[science!]). To do this, +we need to edit our .xinitrc file so our GUI is launched from within a +consolekit session so it can make requests for elevated permissions without +requiring root access. + +For our current example, we have xfce4 installed, so we will be editing +the line that likely looks like <pre> exec startxfce4 </pre> We want our +xfce4 session to launch from within consolekit, so we change the line to +look like... + +---- +exec ck-launch-session startxfce4 +---- + +That should be it. Log yourself out of your X session (if you are logged in) +and log back in and you should be able to connect to wifi networks without +having to give your root password. + + +Category:Linux + +// vim: set syntax=asciidoc: diff --git a/src/Note-taking_with_Vim.ascii b/src/Note-taking_with_Vim.ascii new file mode 100644 index 0000000..4aea378 --- /dev/null +++ b/src/Note-taking_with_Vim.ascii @@ -0,0 +1,115 @@ +Note-taking with Vim +==================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Two vim posts in one day! + +My task list at work has recently become so large (it's probably well over a +year's worth of work now) that I now need to track my tasks somewhere other +than in my head (documentation is always better than tribal knowledge anyways). +I realy don't like task tracking becuase most of the applications out there are +just so heavy for what note-taking actually is. I use vim almost all day, every +day though, so why not use that (plus it's command line!)? + +I spent about thirty minutes writing this up today. It's inspired a bit by the +LifeHacker article, +http://lifehacker.com/5592047/turn-your-command-line-into-a-fast-and-simple-note+taking-tool[Turn +Your Command Line into a Fast and Simple Note Taking Tool] (thanks +http://mottr.am/[Jack Mottram]). + +This will automagically give all of your notes a .wiki extension, telling vim +to use the mediawiki text syntax highlighter (I use MediaWiki a lot to so I +figured I'd use that syntax for markup). This can be found +http://en.wikipedia.org/wiki/Wikipedia:Text_editor_support#Vim[here]. If you +want to use something else like markdown, just change the $noteExt variable at +the top to the extension associated with the highlighter you want. + +This addition will give you six new commands. + +* +**note** [NoteName]+: Opens a note for editing or creates +a new note. If no note is specified, opens the most recent note. +* +**mknote** NoteName "Note to append"+: Appends text to the +requested note. +* +**catnote** [NoteName]+: Prints the contents of the +specified note. +* +**lsnotes**+: Lists all notes by date modified +* +**findnote** SearchTerm+: Searches all notes for the +search term (case insensitive) and prints the results along with note +title and line number on which the term was found. +* +**mvnote** OldName NewName+: Renames a note +* +**rmnote** NoteName+: Deletes the specified note. + +Add the following to your .bash_profile (or .profile if you're a ksh user) + +---- +export base=~/Documents/Notes +export noteExt=wiki +# This would be used for markdown +# export noteExt=md +note() { + if [ ! -d $base ]; then + mkdir -p $base + fi + # If note not specified, open most recent + if [[ -z "$1" ]]; then + vim $(ls -t $(find $base/ -type f) | head -n 1) + else + vim $base/$1.$noteExt + fi +} + +mknote() { + echo $2 >> $base/$1.$noteExt +} + +catnote() { + # If note not specified, cat most recent + if [[ -z "$1" ]]; then + cat $(ls -t $(find $base/ -type f) | head -n 1) + else + cat $base/$1.$noteExt + fi +} + +lsnotes() { + #ls -1 $base/ | sed "s/\(.*\).$noteExt/* \1/" + echo + echo -e "Last Modified\tName" + ls -lt $base/ | tr -s ' ' | cut -d ' ' -f 6,7,8,9 | sed "s/^\(\w\+\) \(\w\w\) \(\w\w:\w\w\) \(.*\).wiki/\1 \2 \3\t\4/" + echo +} + +findnote() { + if [[ -n "$1" ]]; then + contents="Note:Line:Text\n\n" + contents=$contents$(find $base/ -type f | xargs grep -n -i "$1" | sed "s/.*\/\(.*\)\.$noteExt:\([0-9]\+\):\(.*\)/\1:\2:\3/") + echo -e "$contents" | column -s ":" -t + else + echo "Please specify a search term." + fi +} + +mvnote() { + mv $base/$1.$noteExt ~/Documents/Notes/$2.$noteExt +} + +rmnote() { + if [[ -n "$1" ]]; then + rm $base/$1.$noteExt + else + echo "Please specify a note." + fi +} +---- + + +Category:Linux +Category:Vim +Category:Productivity + + +// vim: set syntax=asciidoc: diff --git a/src/Perfect_Server_Debian_Installation_-_Pureftpd_Won't_Start.ascii b/src/Perfect_Server_Debian_Installation_-_Pureftpd_Won't_Start.ascii new file mode 100644 index 0000000..47eaaa5 --- /dev/null +++ b/src/Perfect_Server_Debian_Installation_-_Pureftpd_Won't_Start.ascii @@ -0,0 +1,93 @@ +Perfect Server Debian Installation - Pureftpd Won't Start +========================================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently rebuilt the server hosting my website on a different vps host using +falko's "The Perfect Server Debian Lenny (Debian 5.0) With MyDNS & Courier +[ISPConfig 3]" and ran into some pretty problematic setbacks. Specifically, +pure-ftpd wouldn't start up. Even more specifically, when trying to start the +service, it gives you this fantastically ambiguous error: + +---- +Starting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot -l +mysql:/etc/pure-ftpd/db/mysql.conf -l pam -u 1000 -E -A -b -O +clf:/var/log/pure-ftpd/transfer.log -D -H -B +---- + +Give me ambiguity or give me something else, yeah? + +Anyways, I've experienced this problem two other times. Sadly, both times I +forgot where the solution was located on the interwebz. Finally, the third time +around I've found it again and here we go. + +**The problem resides in the fact that the server is a vps hosted through +either virtuozzo or openvz**. Apparently, unless otherwise configured +differently, the virtual containers don't support something that prevents +pure-ftpd from starting up. Sorry for the ambiguity, but I'm really not sure +what it is. *The solution is to build pure-ftpd from source, "without +capabilities".* Let's get started Run the command... + +---- +apt-get source pure-ftpd +---- + +Once that has been downloaded, change directories into the apt archives +directory... + +---- +cd /var/cache/apt/archives/pure-ftpd* +---- + +Inside here you'll find a directory called debian. Run the following command + +---- +vi ./debian/rules +---- + +add --without-capabilities to optflags in debian/rules + +Once you've done that, run the following command. + +---- +apt-get build-dep pure-ftpd +---- + +Annnd another command + +---- +dpkg-buildpackage -uc -b +---- + +Congradulations! You just built pure-ftpd from source with a custom flag! Now +it's time to install the package. To do this, we're going to run ANOTHER +command (they don't call it command line for nothing). + +---- +dpkg -i ../pure-ftpd-common_1.0.1-8_i386.deb +---- + +Finally, run this one last command to install MySql for pure-ftpd so the +service can connect to a MySql database where your users and their permissions +will be stored. + +---- +dpkg -i ../pure-ftpd-mysql_1.0.1-8_i386.deb +---- + +And finally you are done. Hopefully this helped some poor lost soul out there +besides just mine. If you find any problems or just want to tell the world +something, please leave a comment in the comments section (spam bots, you +aren't included in that offer. If you try I will http://akismet.com/[Akismet] +you!). + + +Category:Linux + +Category:Debian Category:FTP + + +// vim: set syntax=asciidoc: diff --git a/src/Performing_a_MySql_Backup_Via_Command_Line.ascii b/src/Performing_a_MySql_Backup_Via_Command_Line.ascii new file mode 100644 index 0000000..91e049e --- /dev/null +++ b/src/Performing_a_MySql_Backup_Via_Command_Line.ascii @@ -0,0 +1,42 @@ +Performing a MySql Backup Via Command Line +========================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +A few months back I was running backups of the ol' web server and realized that +it was going to be a pain since I was starting to host more and more websites. +Logging into phpMyAdmin and exporting every database can be a bit cumbersome +when you have a lot of databases. With that, I wanted a good solution for +dumping my entire database server. Thankfully, the solution is a really simple +one (if you have console access). Many thanks to the MySql devs for creating +this feature (as if they wouldn't what good is a database you can't back up +after all). + +As I mentioned, this is really simple. To export all of your databases +that you have running, including create statements, run the following +command... + +---- +mysqldump -u root -p --all-databases > /tmp/dumpfile.sql +---- + +So here's what we just did. + +* *-u* root specifies the user. In this case, root is who we are logging +in. +* *-p* makes it ask for a password (it will try to log in without using +a password if this isn't used) +* *--all-databases* makes it export all databases (duh) + +Ordinarily, this command outputs to the console. It's not the most useful thing +in the world unless you use the greater than. The > makes it write that output +to the specified location rather than to your console window. + + +Category:MySQL + + +// vim: set syntax=asciidoc: diff --git a/src/ProPresenter:Action_Hotkeys_Not_Working.ascii b/src/ProPresenter:Action_Hotkeys_Not_Working.ascii new file mode 100644 index 0000000..26daa1f --- /dev/null +++ b/src/ProPresenter:Action_Hotkeys_Not_Working.ascii @@ -0,0 +1,36 @@ +ProPresenter:Action Hotkeys not Working +======================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +My church recently got a new Mac mini for our media computer (we used to have a +Windows 7 machine). During setting this new system up, I realized that the +ProPresenter action hotkeys didn't work (eg: Clear all is F1, Clear foreground +is F2, Clear backgrounds is F3, etc). I don't know about you, but having +hotkeys is a pretty priceless piece of efficient computing, especially if +you're running media in a fast-paced presentation environment. After a little +research, I discovered that Apple, in their infinite wisdom (because that's not +an inflammatory statement), in fact disabled the OS functionality for the +function keys and by default they control hardware functionality (eg: F1 and F2 +control brightness, F3 does nothing, F4 does nothing, F5 does nothing, F6 does +nothing...getting the idea?). Here's how you fix it. + +Head on over to the __System Preferences__. In there, select __Keyboard__. +There are two tabs in there (Keyboard and Keyboard shortcuts). If _Keyboard_ +isn't selected, select it. On that page you should see a checkbox labeled +"__Use all F1, F2, etc. keys as as standard function keys__". Check that box +and all of your ProPresenter action hotkeys should work now (Yay!). + +If anyone wants to look up my source for this, I found the solution in the +Apple knowledge base http://support.apple.com/kb/HT3399[here]. + + +Category:ProPresenter + +Category:Apple + + +// vim: set syntax=asciidoc: diff --git a/src/ProPresenter:Automatically_Advancing_Slide_Loops.ascii b/src/ProPresenter:Automatically_Advancing_Slide_Loops.ascii new file mode 100644 index 0000000..cdf686b --- /dev/null +++ b/src/ProPresenter:Automatically_Advancing_Slide_Loops.ascii @@ -0,0 +1,56 @@ +ProPresenter:Automatically Advancing Slide Loops +================================================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +This last weekend I ran video for my church and needed to create a slide loop +for announcements at the beginning of service. Now, I'm a MediaShout guy still +so I'm used to whole projects, Bible verse _references_ instead of playlists, +queues, and the good ol' quad monitor (come on, who doesn't love that thing). +As I have come to find out however, ProPresenter is not MediaShout in any way +(not that that is a bad thing). To make matters a bit more difficult, Google +didn't have much on how to do this...until now (queue dramatic music). Before +we get going though, I want to mention that this could be done with a timeline +and playlist. For this time around though we will just use timers. With that, +let's get started! + +Firstly, create a new item in the Library + +image:files/ProPresenter_Slide_Loops00.png[height=350] + +You should now have an empty playlist. + +Add the images you want from your Video/Image bin. To do more than one at a +time without launching the slide on the projector, use ctrl+click to select +multiple items and ctrl+click to drag to the playlist window. + +image:files/ProPresenter_Slide_Loops01.png[height=400] + +Once you've added all the images you want for your loop, right click each one +and select **Go to Next Timer...**. + +image:files/ProPresenter_Slide_Loops02.png[height=400] + +A new window will open with a field labeled _Seconds_ and a checkbox labeled +__Loop to first slide__. Click the up arrow or manually enter the number of +seconds you want each slide to display for before advancing to the next. Also, +you typically don't want to check the _Loop to first slide_ unless you want +your slide loop to end on that slide. + +image:files/ProPresenter_Slide_Loops03.png[height=200] + +Once you have applied timers to all the slides you want in your playlist, +simply add the library playlist to the presentation playlist. Now if you +launch any of the slides in the library playlist, it will auto-advance and loop +through no matter which slide you launch first. + +image:files/ProPresenter_Slide_Loops04.png[height=400] + + +Category:ProPresenter + + +// vim: set syntax=asciidoc: diff --git a/src/ProPresenter:Edit_Mode.ascii b/src/ProPresenter:Edit_Mode.ascii new file mode 100644 index 0000000..5c5dc43 --- /dev/null +++ b/src/ProPresenter:Edit_Mode.ascii @@ -0,0 +1,49 @@ +ProPresenter:Edit Mode +====================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +This week one of our media folks contacted me to ask if I knew how to get +ProPresenter to launch slides again. He said he was clicking them, but they +wouldn't launch on the external or primary monitors. Instead, they were simply +selecting. + +This one actually took me a while to figure out because like most things with +ProPresenter, there is very little if any documentation on it. That said, let's +get started with this document. + +If you look at the top left of your slide list, you'll see a little icon of a +lock (it may be locked or unlocked). If you're having issues getting slides to +launch, chances are this icon is showing "unlocked". + +image:ProPresenter-Slide_lock-unlocked.png[height=300] + +This effectively means you're in edit mode instead of presentation mode (I'm +making these terms up - they're not official in the slightest). + +If you are showing unlocked, simply click it to lock the presentation so you +can launch slides again. + +image:ProPresenter-Slide_lock-locked.png[height=300] + +[[uses-for-edit-mode]] +Uses for Edit Mode +~~~~~~~~~~~~~~~~~~ + +Edit mode is great for building presentations. When in it, you can select +multiple slides and drag them around to reorder them. If you aren't in edit +mode though and you need to move slides around on the fly, you're in luck! Just +press and hold the Ctrl key and you'll see the "locked" icon temporarily switch +to "unlocked". While you have the key pressed, you can click and drag slides +around all you want. You can even select multiple and really start to mess +things up quick! + +image:ProPresenter-Multiselect_Move.png[height=300] + +Category:ProPresenter + + +// vim: set syntax=asciidoc: diff --git a/src/Redirecting_a_WordPress_Site.ascii b/src/Redirecting_a_WordPress_Site.ascii new file mode 100644 index 0000000..2f5c212 --- /dev/null +++ b/src/Redirecting_a_WordPress_Site.ascii @@ -0,0 +1,48 @@ +Redirecting a Wordpress Site +============================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Last week I decided to completely move my blog over to bitnode.net. I created a +post in the old location with the details of the move and watched my viewer +metrics slowly shift sites. However, Google is still indexing my old site and +it is still showing up at the top of the results while this new blog is just +hanging around on page four. This makes for a very sad day for all (or possibly +just me). + +With that, I decided to do a redirect. There are several options for a +redirect, but what I wanted was a bit different than the typical domain +forward. I wanted to be able to keep my post locations, but have the domain +name change. Since the paths to my posts are the same format between the old +location and the new location, doing a simple append to the redirect url would +suffice. Here's how I did it. + +At the top of my header.php file (yep, WordPress), I added the following +lines... + +---- +<?php header("HTTP/1.1 301 Moved Permanently"); +header('Location: http://bitnode.net/'.$_SERVER["REQUEST_URI"]); exit(); +?> +---- + +Since this is in my header file, it loads on every page. What's nice about this +solution is that it takes the path to the current page and appends it to +bitnode.net redirect location, so if your source and destination URI formats +are the same, it will be a seamless redirect. + +This solution works well, but does anyone have any other solutions that would +also work? It never hurts to know all the different ways after all. + +*Edit:* As it turns out, you can do the same thing from WordPress to Drupal. +They evidently support the same URI formats. + + +Category:WordPress +Category:PHP + + +// vim: set syntax=asciidoc: diff --git a/src/Replacing_the_Glass_on_a_Samsung_Galaxy_S_iii.ascii b/src/Replacing_the_Glass_on_a_Samsung_Galaxy_S_iii.ascii new file mode 100644 index 0000000..c79fdd7 --- /dev/null +++ b/src/Replacing_the_Glass_on_a_Samsung_Galaxy_S_iii.ascii @@ -0,0 +1,133 @@ +Replacing the Gladd on a Samsung Galaxy S III +============================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently had the misfortune of shattering the glass on my phone's screen. I +went to put it in my pocket, I felt one corner of the phone go in, but +apparently that wasn't enough because my phone fell out of my pocket instead of +in. There's this funny thing about gorilla glass. Apparently, if you strike it +just right at one of its weak spots, the corners, it's enough to shatter [hopes +and dreams] it into many, many pieces. Thankfully though, someone produces a +replacement piece of gorilla glass to replace and hopefully restore said broken +dreams...er...glass. + + +[[finding-the-parts]] +== Finding the Parts + +Really all you need for this is a blow drier or heat gun, a sharp and/or thin +knife, a credit card or a guitar pick which you don't care about, and the +replacement glass. If you have a infrared thermometer, you might want to use +that to gauge the temperature as you go, but I doubt it's necessary. If you do +have one though, I heated my phone's screen to about 200° F. + +So with that, I went on the interwebs to find a replacement screen, which to my +surprise, costs about $260 on Amazon. As it turns out, screens for the Galaxy S +iii are incredibly costly because with this phone, screen means glass AND +digitizer since they are glued together. What I needed was just the glass. I +searched Amazon some more and stumbled upon +http://www.amazon.com/Samsung-GT-i9300-Display-included-Replacement/dp/B0096TUA0G/ref=pd_ys_sf_s_2335752011_a1_5_p[this +one]. When I bought that one week ago, it cost exactly $23.01. Today, just over +a week later, it costs $34.99. It looks like this guy might be drop shipping +because the price for +http://www.ebay.com/itm/Replacement-Screen-Glass-Lens-for-Samsung-Galaxy-SIII-S-3-i9300-White-TOOLS-/180936781341[the +screen on Ebay] also went up in the last week from about $20 to $28.99 WITH the +tools. Either way though, buying just the glass is still a $200 cheaper than +buying the entire digitizer and glass assembly. + +Now, I'd like to note before going on that, yes, it is cheaper to replace just +the glass on your phone, but it's also more dangerous. You could scratch up +your digitizer pretty bad or shatter it in the process of getting the glued +glass off. The way I look at it though, why not try because if you fail you'll +have spent $260 + $30, but if you succeed you will have saved yourself over +$200. + + +[[some-precautions]] +== Some Precautions + +Before you start, pull off your back cover and remove your battery, sim card +(if you have a gsm phone), and micro sd card. + + +[[the-instructions]] +== The Instructions + +Now with that, the Youtube video I watched to give me an idea of what to expect +can be found +http://www.youtube.com/watch?annotation_id=annotation_515371&feature=iv&src_vid=aZuiCsAtThw&v=W4Gx5fLy0NQ[here]. + + +[[some-tips]] +== Some Tips + +I used a blow drier to heat my phone up. I found that the glue was workable at +about 180°F. I never got my phone above about 205°F. + +Start at the top of the phone if possible. The bottom has some wires that +attach under the glass to the back and menu buttons and you don't want to break +those. + +Once you get the glass up, use the credit card, guitar pick, or other flat soft +plastic object to keep the glass up and work the glue out. + +I was surprised to find that the digitizer is actually a pretty durable layer. +There were a few things I did that I thought for sure were going to shatter it, +but it was completely fine. I ended up with only one real nick (thankfully). + +Finally, it took me about two hours and thirty minutes to complete because my +glass was so shattered. + + +[[the-gallery]] +== The Gallery + +____ +image:files/Img_2335_gsiii-no-glass-sm.jpg[height=400,link="files/Img_2335_gsiii-no-glass-sm.jpg"] + +The phone with its glass pulled off in a pile next to it. I used the knife to +jimmy the glass up on the sides so I could get tool in. +____ + +____ +image:files/Img_2337_gsiii-no-glass-dirty-sm.jpg[height=400,link="files/Img_2337_gsiii-no-glass-dirty-sm.jpg"] + +A close up so you can see that tacky glue rolled up all over the place. +____ + + +____ +image:files/Img_2338_gsiii-glass-pile-sm.jpg[height=400,link="files/Img_2338_gsiii-glass-pile-sm.jpg"] +A pile of wondrous gorilla glass +____ + + +____ +image:files/Img_2343_gsiii-no-glass-clean-sm.jpg[height=400,link="files/Img_2343_gsiii-no-glass-clean-sm.jpg"] + +A clean digitizer! +____ + +____ +image:files/Img_2344_gsiii-new-glass-sm.jpg[height=400,link="files/Img_2344_gsiii-new-glass-sm.jpg"] + +Finally got the glass on. +____ + +____ +image:files/Img_2348_gsiii-new-glass-and-case-sm.jpg[height=400,link="files/Img_2348_gsiii-new-glass-and-case-sm.jpg"] + +The new case so I don't shatter my NEW glass too. +____ + + +Category:Samsung +Category:Phones +Category:Sprint + + +// vim: set syntax=asciidoc: diff --git a/src/Running_Web_Services_on_Non-Standard_Ports.ascii b/src/Running_Web_Services_on_Non-Standard_Ports.ascii new file mode 100644 index 0000000..5f9eaf0 --- /dev/null +++ b/src/Running_Web_Services_on_Non-Standard_Ports.ascii @@ -0,0 +1,66 @@ +Running Web Services on Non-standard Ports +========================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Working in the world of systems administration has taught me a lot, especially +in regards to security. One thing I hope to never take for granted is the +seemingly endless pool of knowledge there is in IT departments. There's almost +always something new to learn from someone. + +Since I have been learning so much from other people, I decided to rebuild my +web server in an attempt to harden it a bit and to practice building stuff (who +doesn't like building stuff, I mean come on...Legos anyone?). One of the things +I changed in my process was building everything from source with non-privileged +users rather than installing it from repos. One of the advantages to doing this +is that each of your services will be running as users that have no access to +the rest of the system if their accounts are set up right (ie: no sudo, ssh, or +cross service access). The one disadvantage to this is that the services can't +bind to ports 1024 and below. For web servers, this really only affects apache, +nginx, light httpd, or whatever web server you are using since most other +software (ie: php, mysql, etc) runs on ports higher than 1024. + +With that, people don't visit our websites on some randomly selected port for a +web server, do they? + +Nope + +So how do we allow them to visit our web server running on a different port +other than 80? + +The answer is iptables using NAT. Basically what we need to do is take incoming +traffic to port 80 and route it to our web server port (in my case, this is +8080). This of course can work for other services as well, but for the purposes +of this post, we'll simply translate port 80 traffic. + +The iptables commands you'll need for this are as follows: + +---- +iptables -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 +---- + +What we've got here is not super hard. Basically, before we do anything else +(PREROUTING chain) with our port 80 (--dport 80) tcp (-p tcp -m tcp) network +traffic, we want to redirect (-j REDIRECT) the traffic to port 8080 (--to-ports +8080). You can of course do this with https traffic as well. Here's another +example using that one. + +---- +iptables -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443 +---- + +Pretty handy, huh? + +One note on this before signing off. If you have your input table set to drop +all, you need to add an accept rule for tcp port 80 and your web server port +(8080 and 8443 in the examples). + + +Category:Linux +Category:iptables + + +// vim: set syntax=asciidoc: diff --git a/src/SSH_Tunnel_Forwarding.ascii b/src/SSH_Tunnel_Forwarding.ascii index 267a621..171262d 100644 --- a/src/SSH_Tunnel_Forwarding.ascii +++ b/src/SSH_Tunnel_Forwarding.ascii @@ -1,3 +1,10 @@ +SSH Tunnel Forwarding +===================== +:author: Aaron Ball +:email: nullspoon@iohq.net + +== {doctitle} + Yesterday, I had an idea that remarkably enough, actually worked (go figure, huh). I have a few friends who use Linux on their desktops but aren't quite Linux gurus (but who am I kidding, neither am I as evidenced by this post). diff --git a/src/Samsung_Epic_4g_Syndicate_Rom_:_Freeze_on_Boot.ascii b/src/Samsung_Epic_4g_Syndicate_Rom_:_Freeze_on_Boot.ascii new file mode 100644 index 0000000..bdcffb8 --- /dev/null +++ b/src/Samsung_Epic_4g_Syndicate_Rom_:_Freeze_on_Boot.ascii @@ -0,0 +1,40 @@ +Samsung Epic 4g Syndicate Rom:Freeze on Boot +============================================ +:author: Aaron Ball +:email: nullspoon@iohq.net + +== {doctitle} + +Recently my girlfriend (who might start blogging Epic 4G rom reviews here) +asked me to root her phone due to the horrendous battery issues the Samsung +Epic 4g/Sprint stock rom causes. After searching around a bit, I finally +decided upon a one click root posted +http://samsungepichacks.com/samsung-epic-hacks/how-to-root-samsung-epic-4g/[here]. +The root went with no snags until I tried to flash Syndicate Rom 1.1.1. The +flashing process indicated there were no issues until I rebooted the phone. It +got stuck in boot. This presented an unfortunate problem for me. As it turns +out, USB support for version 2.5 of Clockworkmod on the Epic 4g is not +functional. Through a very complicated process of pulling the sd card, putting +it in my HTC Evo, copying the files through that, and putting the sd card back +into her phone, I tried different downloads of Syndicate Rom with none of them +working. + +Then it dawned on me... + +The Ext 4 filesystem was introduced into Android at version 2.2 the version +that Syndicate builds on. After some research, I discovered that Clockworkmod +doesn't support Ext 4 until version 3. With that, I searched for Clockworkmod 3 +for the Epic 4g. I flashed version 3.1 and reflashed Syndicate Rom and all was +well. + +There was much rejoicing + +On a related note, I also discovered that if you format the Epic 4g sd card +from Clockworkmod 3, it runs much faster. I can only guess that this is because +the sd card is originally formatted with Samsung's proprietary file system, RFS +(robust file system... see last entry http://en.wikipedia.org/wiki/RFS[here]). + + +Category:Android + +// vim: set syntax=asciidoc: diff --git a/src/Scheduling_Jobs_in_Linux.ascii b/src/Scheduling_Jobs_in_Linux.ascii new file mode 100644 index 0000000..2bfc61b --- /dev/null +++ b/src/Scheduling_Jobs_in_Linux.ascii @@ -0,0 +1,73 @@ +Linux:Scheduling Jobs +===================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitile} + +I was recently needing to schedule the reboot of a print server (Ubuntu), but +was unsure how. After looking around a bit, I can do all kinds of things with +it. For a simple use case though, here is how to reboot a server with at... + +Since we're restarting the server, we need root privileges for that, so +we have to run this as sudo this time around. type: + +---- +sudo at 23:00 +---- + +You should see... + +---- +warning: commands will be executed using /bin/sh +at> +---- + +Type the command you want to occur at 23:00 (11:00 pm). In our case, we're +going to restart the server. + +---- +shutdown -r now +---- + +Press **enter**. From here you press *ctrl+d* and that will save the job for +later execution. + +The cool thing about at is how intuitive it is. For instance, we just used +23:00 to schedule an e-mail for 11:00 pm. Instead, we could have typed **at +11:00 pm**. Furthermore, if we wanted to schedule something for tomorrow at +11:00 pm, we could type **at 11:00 pm tomorrow**. It's a pity for those of us +who are forgetful...the "at" utility unfortunately does not understand +yesterday. + +That's how to do it. + +If you want to list all of the jobs for your user, use the command +**atq**. If you need to remove a job, use the *atrm* command (this uses +job numbers from the list atq produces). + +Happy scheduling. + +... Really, be happy. At least you don't have to be there at 3:00 am to reboot +the server. + +---- +sudo at 3:00 am a> shutdown -r now +---- + +* ctrl+d* + +...later at 11:30 pm + +---- +echo 'ZZZZzzzzzzzzzz...' +---- + + +Category:Linux + +Category:Cron + + +// vim: set syntax=asciidoc: diff --git a/src/Searching_for_a_Command_in_Linux.ascii b/src/Searching_for_a_Command_in_Linux.ascii new file mode 100644 index 0000000..51bb6b8 --- /dev/null +++ b/src/Searching_for_a_Command_in_Linux.ascii @@ -0,0 +1,97 @@ +Searching from Command Line in Linux +==================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +For those of us learning command line for the first time, it can be a pretty +intimidating thing. A terminal in the hands of a person with a black belt in +shell commands can be far more powerful than a GUI (graphical user interface). +However, becoming a so-called black belt takes a lot of time and practice. +Unlike a GUI, you have to memorize the commands you need...mostly. + +I say mostly because there is a command in Linux that is probably one of the +singly most used commands out there. That command is known as the *man* +command. In interviews in response to a question you don't know, "I would just +read the man pages" is the equivalent of "Jesus is the answer to everything" in +church. The great thing is both actually work (not to put an obvious religious +statement in my blog here). + +Man is short for manual. It's like reading your car manual, but for a command +in your shell. For instance, if you run + +---- +man mkdir +---- + +You see something an explanation of what the command does, how to use the +command, and the various advanced features you can do with it. + +But what ifyou don't know what command to use? + +Thankfully, there is a relatively simple solution to this. All you really know +is how to describe what you want to do in a simplistic way. Ladies and +gentlemen, that command is the man -k command. I hope you all didn't pay full +price for your seats because you'll only be using the edge. + + +[[man--k-command]] +== man -k <command> + +The man -k command/switch searches all of the commands that have man +pages for what you typed in to search for. It then returns the command +name with a short explanation of what it does. Let's get some practice +in. + +Say you want to search for how to create a directory. We're going to run + +---- +man -k "make directories" +---- + +And it will return + +---- +mkdir (1) make directories +---- + +Cool, huh? Now, there is a complication to this. If you want to search +for something and the exact text you type isn't in the manual exactly as +you typed it, it will not be returned. For instance... + +---- +man -k "create directory" +---- + +...will return nothing becuase the manual for mkdir has "make directories" in +it, not "create directory". How do we get around this? + +Wild cards and very simple one word searches. + + +[[wild-cards]] +== Wild Cards + +Now, let's say you're not sure if the manual you're looking for has the word +directories, directory, or just dir in it. We need a way to search for multiple +forms of a word. We do this with what is called a wild card character. Run the +following command: <pre>man -k dir*</pre> + +This will search the manuals for any words that start with dir and end with +anything (including spaces or other words). + +Once you've found the command you want, you can simply type <pre>man +<command></pre> and you can read the manual until you're heart is content, or +even until it stops! :) + +On a similar note, to get out of reading a manual, **press the letter 'q**'. I +can't tell you how long it took me to figure that out when I first was learning +about the man pages. I guess now I should be ashamed of myself. + + +Category:Linux + + +// vim: set syntax=asciidoc: diff --git a/src/Streaming_Audio_Over_SSH.ascii b/src/Streaming_Audio_Over_SSH.ascii new file mode 100644 index 0000000..aab6d05 --- /dev/null +++ b/src/Streaming_Audio_Over_SSH.ascii @@ -0,0 +1,71 @@ +Streaming Audio Over SSH +======================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +At home, I have a server/desktop running nearly 24/7 +(https://archlinux.org[Arch Linux] if anyone is wondering). I use this server +for all kinds of experiments. My backups are there (well, it's one of my backup +locations). My home dlna server is there. It's also hooked up to my sound +system for http://musicpd.org[mpd] so I can have it play my music, controllable +by any device on my home wifi. Recently however, I wanted to be able to stream +my laptop's audio over my sound system, without having to plug it in directly. +The reason being I wanted to stream Spotify over said sound system, but didn't +want to go to the hassle of plugging in a keyboard and mouse, and installing a +GUI and plugging my server in to a monitor, just so I can occasionally listen +to music through not-so-bad speakers. Then I wondered, you can do just about +anything with SSH, why not try to stream audio over it. Here's how I do it +(there are many other ways). + +[[requirements]] +== Requirements + +The server (the computer hooked up to the sound system) needs *mplayer* +installed so it'll have something to play the audio with. + +The audio source system (my laptop in this case) needs alsa-utils installed, +specifically for the *arecord* application. + +Obviously both the server and the audio source system need ssh installed (and +the daemon running on the server). + + +[[command]] +== Command + +Not too much to say here. + +---- +arecord -c 1 -r 32000 | ssh <user>@<server> 'mplayer -demuxer rawaudio -rawaudio channels=1:rate=32000:samplesize=1 -nocache -' +---- + +So what that command does is... + +arecord:: + Is a command line program for recording from audio devices. If no output file + is specified (like in this case), it writes what it records to stdout. For + our purposes, we pipe stdout to ssh in the next command. + +ssh...mplayer:: + Here we send stdout from the previous command (hence the pipe) straight to + the server over ssh. Mplayer on the server plays what it receives from stdin + (the final - ). The rest of the mplayer flags are just for audio quality + control (same for the flags on arecord). The -nocache reduces delay a bit, + but in some cases can cause skipping, so you might want to remove that + switch. + + +There is one caveat to this. While it works fine for streaming internet radio +or any other audio you want really, streaming audio for a video source doesn't +work nearly as well. On my setup, there is about a .75 second delay, so YouTube +videos don't sync up. Otherwise though this works swimmingly. + + +Category:Linux +Category:SSH + + +// vim: set syntax=asciidoc: diff --git a/src/Synchronizing_Playlists_with_a_Sansa_Fuze_and_Media_Monkey.ascii b/src/Synchronizing_Playlists_with_a_Sansa_Fuze_and_Media_Monkey.ascii new file mode 100644 index 0000000..cde9853 --- /dev/null +++ b/src/Synchronizing_Playlists_with_a_Sansa_Fuze_and_Media_Monkey.ascii @@ -0,0 +1,62 @@ +Synchronizing Playlists with a Sansa Fuze and Media Monkey +========================================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +My fiance has a Sansa Fuze. It works well for her most of the time, except when +she wants to synchronize her playlists with it. She also uses +http://www.mediamonkey.com/[Media Monkey] for her library management. +Apparently, in recent months Media Monkey has made various updates to their +software that have broken all kinds of stuff (making updates now mandatory of +course to keep things working). One of the things to break was, of course, +playlist syncing. + +Now, her playlists will sync. It will send the playlist file along with all the +music it references to the player, however the playlist file (.m3u) is corrupt +and shows no songs when viewed on the Fuze. When I cracked one of the playlist +files open, I noticed it was referencing the partition on her laptop's hard +drive (H: in this case). That clearly can't be right. To make a long story +short, I played with Media Monkey (version 4.0.3) for some time until I figured +out how to automate the synchronization process without having to go back and +manually edit some playlist files (though I guess a batch script could do the +trick...ugh). + +To sum up the solution, you need to head on over to your Sansa Fuze's options +screen in Media Monkey and set it up to match the following: + +image:files/Sansa-Fuze-MM-Playlist-Options.jpg[height=500] + +So basically, what each of those settings does is + +* Put *#EXTM3U* at the top of each playlist (Use extended M3U) + +* Use relative paths for files (ie: Music\Fiest... rather than + D:\Music\Feist...) (Force relative paths) + +* Set the playlist's location in the root path rather than in your + Playlists directory (Destination directory \ ) + +A sample of a good playlist file that should work with your Fuze looks +like + +---- +#EXTM3U +Music\Unknown Unknown\00 Stuck In the Middle With You.mp3 +Music\Feist Unknown\00 1 2 3 4.mp3 +Music\White Rabbits Unknown\00 Percussion Gun.mp3 +Music\Unknown Artist Unknown\07 Scumbag.wma +---- + +Finally, one semi-related tip on this. I noticed that synchronizing her Fuze in +MTP mode was really slow. If you switch it to MSC, your file transfers will go +much faster (I was able to get a song every two to three seconds). + + +Category:Media_Monkey +Category:Music + + +// vim: set syntax=asciidoc: diff --git a/src/Sysprepping_Server_2008.ascii b/src/Sysprepping_Server_2008.ascii new file mode 100644 index 0000000..0d3ac4f --- /dev/null +++ b/src/Sysprepping_Server_2008.ascii @@ -0,0 +1,76 @@ +Sysprepping Server 2008 +======================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Hello all, + +This my first post on this blog (if it wasn't obvious enough), but I'm going to +spare you all the boring 'welcome to the blog' and get down to business before +I forget what I am blogging about here. + +I do need to mention a few things before getting started though + +My name is Dirk and I work at the College of Business in my university, +specifically on the web development team. I program for SharePoint but also +enjoy building and maintaining servers. My current project is to build and +maintain ten virtual (Hyper-V) Server 2008 development servers for the team. +Each team member needs a semi-isolated development environment with a unique +SharePoint instance so if their tests crash it, it does not affect any other +people. + +Alright, now that that's out of the way, here's the good stuff... + +Now, continuing along the same lines as the subject of this post, I have been +researching the unattend.xml file for sysprepping a system for the last week in +an effort to find a template I could fill out for our latest Server '08 builds. +A guy from another section of our IT department has a sysprep file from Windows +XP, which apparently doesn't work for Server 2008 (well...it was worth a try +though). + +All week I have been Googling things like 'create unattend.xml', 'generate +unattend.xml', 'sysprep unattend.xml', 'sysprep unattend file', and various +other searches that escape me now. Today I thought I'd try sysprep.xml because +I recalled seeing that somewhere. Low and behold, I discovered (as the first +search result), the exact website I needed. It has a template sysprep.xml file +that was actually designed for my exact circumstance (incredible, yes?). + +Here's the link: + +http://msmvps.com/blogs/ad/archive/2008/03/18/windows-server-2008-sysprep-xml-help.aspx + +To use the sysprep.xml file, I have a batch file I created that runs the +command... + +---- +C:\Windows\System32\sysprep\sysprep.exe /oobe /generalize /shutdown /unattend:C:\ProgramData\sysprep\sysprep.xml +---- + +/generalize:: Removes all unique identifiers of the machine. + +/shutdown:: Specifies that the machine shutdown after the sysprep process + rather than restarting + +/unattend:: Process after reboot. + +Many thanks Brian. You brought my seemingly endless search for a sysprep +template file to an end. + +To end on an even more positive note, after sysprepping the server build, I did +not have to respond to a single prompt with the exception of logging in as +Administrator. It did everything for me. + +Regards, + +Dirk + + +Category:Windows + +Category:Microsoft + + +// vim: set syntax=asciidoc: diff --git a/src/TFS_2008:Permissions_for_Creating_Team_Projects.ascii b/src/TFS_2008:Permissions_for_Creating_Team_Projects.ascii new file mode 100644 index 0000000..49f4c42 --- /dev/null +++ b/src/TFS_2008:Permissions_for_Creating_Team_Projects.ascii @@ -0,0 +1,96 @@ +TFS 2008:Permissions for Creating Team Projects +=============================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently finished my Team Foundation build and am quite pleased with it. With +Team Foundation Server being new to me, I ran into a few issues with +permissions. + +The Team Foundation server I built will be managing my team's code as well as +two other teams once everyone has moved over. + +That being said, I need to give out permissions for the managers of each group +so they can create team projects for their teams. + + +[[lets-get-started]] +Let's Get Started +----------------- + +image:files/01TeamExplorerTeamProjects.PNG[height=300] + +Permissions for this are somewhat complicated in that they have to be +given in *for the user(s) to be able to create Team Projects and all of +the other services associated with one. + +We'll start off with the **TFS permissions**. + +image:files/02GroupMemberships.PNG[height=400] + +By default, the service account has permissions to perform these actions so you +should be logged in as that account. + +Head to your Team Explorer in Visual Studio and connect to your Team +Foundation Server. Right-click your server name, go to **Team Foundation +Server Settings**, and select **Group Membership**. From within here you +should see a group titled **Team Foundation Administrators**. +Double-click this group and add your user/group to it and you're done +with the TFS part. + +'''*NOTE* '''To keep the Administrators group from becoming cluttered +with usernames and group names, I created a TFS group for Administrators +( for instance) and simply added that group to Team Foundation +Administrators. + +Next up we'll tackle **SQL Reporting Services permissions**. + +image:files/03SQLServerReportingServices.PNG[height=250] + +For this one you want to go to your SQL Reporting Services page (mine was +http://servername/Reports ). + +Once there, click the *Properties* tab. Click *New Role Assignment* on +the page that loads. From here, enter the active directory username or +group name you want to have permissions to create team projects in TFS +and assign them * the *Content Manager* role. Once you're done, click +*OK* and you're done with the permissions for SQL Reporting Services. + +Finally, **Windows SharePoint Services permissions**. + +image:files/04CentralAdministration.PNG[height=350] + +Head to your central administration site (Start -> Administrative Tools +-> SharePoint 3.0 Central Administration). Once there, click the +*Operations* tab at the top left. On that page, select *Update farm +administrators's group* (it's under the Security Configuration group). From +here, click *New* to add a new user (the button also has a drop down function +so if you get that, click **Add User**). On the **AddUser: Central +Administration page**, type in the username or groupname and add them to the +*Farm Administrators [Full Control]* group. + +There you have it. You should now be good to add as many Team Projects +as you desire. + +[[a-closing-thought]] +A Closing Thought +----------------- + +I would recommend that the majority of this be done through active +directory groups. It makes usermanagement much easier. If someone quits +or it let go, all you have to do is remove their account from the group +in active directory and it takes care of everything in Sharepoint, TFS, +and SQL Reporting services instead of having to manually go in and +remove the person from every location. + +On a side note, I'm going to get some lunch... + +Category:Microsoft + +Category:Team_Foundation_Server + + +// vim: set syntax=asciidoc: diff --git a/src/Team_Foundation_Server_2010_Beta_1_Configuration.ascii b/src/Team_Foundation_Server_2010_Beta_1_Configuration.ascii new file mode 100644 index 0000000..ca86854 --- /dev/null +++ b/src/Team_Foundation_Server_2010_Beta_1_Configuration.ascii @@ -0,0 +1,78 @@ +Team Foundation Server 2010 Beta 1 Configuration +================================================ +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +After finishing my last post on the installation of Team Foundation Server 2010 +Beta 1, I closed down for the day and went home (now now, no judging...that was +a long post). Today I'm back to go over the configuration of TFS 2010 Beta. + +If you're coming to this blog post from my last one on the installation of TFS +2010 Beta, you will have just restarted your server and the Team Foundation +Server configuration screen should be up. That's where we'll be starting here. + +image:01_Welcome.jpg[height=300] + +At the first configuration page, you must decide which confiruation path you +want to take. The descriptions that the page gives are quite helpful in +deciding which path to take since they give "You want to use this if..." and +"You don't want to use this if..." sections for each option. For my purposes +(Single-server installation with Sharepoint not installed yet and using the +default instance of SQL Server), the *Default Configuration* will suffice. +Click **Next**. + +The next page of the configuration wizard (if Default Configuration was +selected) simply indicates that some tests will be performed on the server to +determine if certain pre-requisites are met for a proper configuration. Click +**Next**. + +image:03_Enter_Service_Account.jpg[height=300] + +Here you are prompted for a service account. This account will be used as the +service account to run Windows Sharepoint Services (WSS) and SQL Reporting +Services. For my instance, I created a domain user account called TFSWSSService +(creative, yeah?). If you want, you can click *Test* to confirm that the +username and password work. After typing in the requested username and +password, click **Next**. + +image:04_Rediness_Checks_Successful.jpg[height=300] + +Here the configuration wizard runs tests on your server to confirm everything +is installed properly. The first time through, I received a warning on the +first test because my firewall was disabled (I talked about that in the last +post regarding installing TFS). Since we're all learning here, I elected to +re-enable my firewall so I could have the problems that accompany closed +firewall ports (the more problems you have, the better you get at +troubleshooting the given system, right?). Click **Next**. + +image:05_Applying_Configuration_Settings.jpg[height=300] + +Here's where the real fun begins...if you can classify sitting around for about +20 minutes watching a looping progress bar as fun. + +image:06_Success.jpg[height=300] + +Once the configuration is complete and assuming you had no errors or warnings +on previous screens, you should seen a screen that says what we all love to +exclaim at the end of a long project...SUCCESS. The great thing is that if you +click **Next**, it continues to say Success as well as telling you where you +can find the configuration log. How considerate. Click **Close**. + +That's it for now. If you followed my last post on the installation of TFS, you +probably noticed that I installed Team Build as well as TFS. My next post will +be on the configuration of Team Build. + +Thanks for reading. + +Dirk + + +Category:Microsoft + +Category:Team_Foundation_Server + + +// vim: set syntax=asciidoc: diff --git a/src/Theming_Gnome-Shell_Intro.ascii b/src/Theming_Gnome-Shell_Intro.ascii new file mode 100644 index 0000000..e09a87c --- /dev/null +++ b/src/Theming_Gnome-Shell_Intro.ascii @@ -0,0 +1,48 @@ +Theming Gnome Shell:Intro +========================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +For the last several months, I've been running gnome-shell full time. For +those of you who don't know what this is, it is version 3 of Gnome, one of the +many available Linux graphical user interfaces (see +http://en.wikipedia.org/wiki/GNOME[here] for more info). We are currently on +something like 2.3 for the stable release of Gnome I believe. + +With this new major release of Gnome, its developers significantly changed the +interface in an attempt to simplify window and virtual desktop management, +bringing Linux just one step closer to being more "user friendly". + +Along with all of this change came a new method for theming and tweaking the +look and feel of things. In the past, Gnome used multiple configuration files +that were cumbersome to edit. In this new release, Gnome has switched over to +using...you guessed it... CSS! How exciting. + +Continuing on, for those of you who don't know what CSS is, it's basically a +"programming language" (I know I know, it's not technically a programming +language) used primarily to style websites. In most cases this takes the form +of setting the background image or color, font size, family and color, and +various other style-related things on the interwebz. This is really great +because standards are already in place for CSS making Gnome-shell much easier +to theme and learn to theme. + +If anyone reading this blog doesn't personally know me (which is quite likely +since Google knows more people than I do), I'm basically addicted to theming my +computer. If you ask my girlfriend, while we were in college together she would +be doing homework and I would theme my computer for hours on end when I SHOULD +have been doing my homework. When Gnome-shell came out, I got addicted pretty +quickly. + +This post is a precursor to my theme postings. I've made so many out of boredom +(and that I just can't seem to find quite the right look) that I feel kind of +bad not posting them for all to use. I will also write a few posts regarding +how to theme Gnome-shell as well. But first, some themes!!! + +Category:Linux +Category:Gnome + + +// vim: set syntax=asciidoc: diff --git a/src/Ubuntu_-_Installing_Sun_Java.ascii b/src/Ubuntu_-_Installing_Sun_Java.ascii new file mode 100644 index 0000000..dcad72a --- /dev/null +++ b/src/Ubuntu_-_Installing_Sun_Java.ascii @@ -0,0 +1,26 @@ +Ubuntu:Installing Sun Java +========================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +*Note to self:* + +Ubuntu no longer includes the Java repos in their default builds. + +To install Java on a recent Ubuntu machine (9.04 and up I believe), use the +following command line commands to install it. + +---- +sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" +sudo apt-get update sudo apt-get install sun-java6-jdk +---- + + +Category:Linux +Category:Ubuntu + + +// vim: set syntax=asciidoc: diff --git a/src/Ubuntu_Bridging_Network_Interfaces.ascii b/src/Ubuntu_Bridging_Network_Interfaces.ascii new file mode 100644 index 0000000..94ec3a5 --- /dev/null +++ b/src/Ubuntu_Bridging_Network_Interfaces.ascii @@ -0,0 +1,126 @@ +Ubuntu:Bridging Network Interfaces +================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I have recently been struggling with configuring an Ubuntu server to allow +bridging network interfaces. I had one working long ago on another test +machine, but it was overwritten with a new install. That being said, for quite +some time today I researched this and never really found an answer. I did +however find a few websites that eluded to possible methods for doing this. +After piecing said methods together, I managed to bridge four Ethernet ports +together. + +All that being said, + + +[[heres-what-i-needed-to-do...]] +== Here's what I needed to do... + +I have four ethernet ports on this awesome quad core xeon processor (hehe...I +have to brag a little bit at least) powered server. One port plugs into the +switch and provides the box with access to the interwebz. Another port goes to +another server, supposing to bring the int3rw3bz to that box as well. The third +port goes to a wireless router, providing wireless access to the 1nt3rw3bz. + +Let's see how poor my spelling of 1nt3rw3bz can get by the end of this... + +[[example-assumptions]] +=== Example Assumptions + +You have at least two network adapters. In this case I have +four Ethernet adapters. This post will be working with those four. + + +[[how-to-do-it]] +=== How to do It + +Run + +---- +sudo apt-get update +---- + +to make sure that all of your repositories know of the latest software. + +After that, run + +---- +sudo apt-get install bridge-utils +---- + +This will install the necessary software to seamlessly bridge network +interfaces. + +Now... + +Using your favorite text editor, crack open /etc/network/interfaces + +---- +sudo vim /etc/network/interfaces +---- + +If you haven't done any manual customization of network interfaces yet, you +should see something like... + +---- +auto lo iface lo inet loopback +---- + +After this entry, type in + +---- +auto iface inet dhcp bridge_ports <interface> <interface> <interface> +---- + +For my specific situation, I used... + +---- +auto br0 (or auto <bridgename>) iface br0 inet dhcp bridge_ports eth3 eth0 eth1 eth2 +---- + +After that, type + +---- +sudo /etc/init.d/networking restart +---- + +... and that will bring online your bridge along with all the bridged ports. + +**If you need your box to have a statically assigned ip address**, don't assign +it to the interface with the physical internet connection (in my case, eth3). +Instead, assign it to the bridge itself. + +In a situation like mine, your bridge interface would look like... + +---- +auto br0 +iface br0 +inet static +address 10.0.1.185 +netmask 255.255.255.0 +network 10.0.1.0 +broadcast 10.0.1.255 +gateway 10.0.1.1 +bridge_ports eth3 eth0 eth1 eth2 +---- + +There you have it. A network bridge between as many interfaces as you want (or +at least the four I tested it with). This of course will work with wireless +interfaces as well, such as bridging an ethernet port to a wireless connection, +essentially allowing a machine physically connected to a computer with wireless +to not have to physically be connected to a wireless router (internet comes in +through the wireless card and piped through to the ethernet port). + +Happy bridging everyone! + + +Category:Linux +Category:Ubuntu +Category:Networking + + +// vim: set syntax=asciidoc: diff --git a/src/Upgrading_TFS_2008_Workgroup_to_TFS_2008_Standard.ascii b/src/Upgrading_TFS_2008_Workgroup_to_TFS_2008_Standard.ascii new file mode 100644 index 0000000..3edd743 --- /dev/null +++ b/src/Upgrading_TFS_2008_Workgroup_to_TFS_2008_Standard.ascii @@ -0,0 +1,54 @@ +Upgrading TFS 2008 Workgroup to TFS 2008 Standard +================================================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +About a month ago I was assigned the task of learning how to build and maintain +a team foundation server. To avoid the costs of purchasing licenses for a +software we were only testing for a production environment, we decided to use +our MSDNAA copy for our test. Incidentally, the version MSDNAA distributes to +schools is the **workgroup edition**. + +After the build was completed, I decided that Microsoft's Visual Studio Team +Foundation Server would do everything (and more) that we needed. Due to legal +restrictions, I couldn't/shouldn't use the MSDNAA license for a production +environment. Additionally, the workgroup license for TFS only supports five +users, hardly enough for my team's purposes. + +Naturally I wanted to avoid have to reinstall Team Foundation Server since +simply inserting the new license key would be the easiest thing to do, if the +software supported it. I searched around the web for a bit and found a +Microsoft article on upgrading from workgroup to standard, but it was for TFS +2005. None-the-less, it was worth a shot. Coicidentally, it was not too far +off. Here's how I upgraded my copy and a problem I ran into in the process. + +If you go into your *Programs and Features* (if you're using Server 2003 go to +**Add or Remove Programs**) on your server that TFS is isntalled on, double +click the uninstaller for **Microsoft Visual Studio 2008 Team Foundation Server +ENU**(assuming your copy is English). On the window that comes up you should +see an option at the bottom to upgrade to Team Foundation Server. Check that +radio button and enter the new license key you have and click Next. You * see a +window that says upgrade was successful. + +The problem I had with this method was that when I checked the radio button, +the license key text boxes remained greyed out. When I clicked Next, hoping to +see a place to input the new license key, I was met with a screen that said my +upgrade was successful, though it wasn't. + +Insert/mount your Team Foundation Server disk/image and run the installer. It +should give you options to repair, uninstall, or upgrade. In my case, the +upgrade option automatically showed the license key for my disk. I selected +that option, clicked Next, and my edition was upgraded to TFS standard. + +Tada! + + +Category:Microsoft + +Category:Team_Foundation_Server + + +// vim: set syntax=asciidoc: diff --git a/src/Using_SpiderOak_with_Qt_4.7.2.ascii b/src/Using_SpiderOak_with_Qt_4.7.2.ascii new file mode 100644 index 0000000..1dde898 --- /dev/null +++ b/src/Using_SpiderOak_with_Qt_4.7.2.ascii @@ -0,0 +1,57 @@ +Using SpiderOak with Qt 4.7.2 +============================= +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +I recently updated my KDE version to 4.6, a revolutionary update if I say so +myself. Suddenly version 4 of KDE is awesome. + +All was well with this update until I tried to run SpiderOak. It booted and +then failed with no errors. Upon running it from command line to see the +output, it returned the following error: + +---- +Cannot mix incompatible Qt library (version 0x40702) with this library (version 0x40701) Aborted +---- + +How depressing is this? As it turns out, SpiderOak versions 9810 and before are +intended for use with Qt from an earlier version of KDE. + +After some time of messing around with libraries and symbolic links, I found +the solution. + +When SpiderOak starts, it apparently does a library version check. If you check +the Spideroak library directory (**/usr/lib/SpiderOak**), you will find that +there are many libraries that presumably SpiderOak uses. At least, I thought +that was the case. Now I think (though this may not be correct) that those +libraries are there to perform the version check because if you overwrite them +with more up-to-date libraries, everything works. With that, here's how we do +this. + +Log in as root (or sudo bash) and type the following commands... + +---- +cp /usr/lib/libQtCore.so.4 /usr/lib/SpiderOak cp /usr/lib/libQtGui.so.4 +/usr/lib/SpiderOak cp /usr/lib/libQtNetwork.so.4 /usr/lib/SpiderOak +---- + +This will overwrite the library files in the SpiderOak directory with symbolic +links (the files we copied were already links to *.so.4.7.2) pointing to the +most up-to-date versions of the libraries on your machine. + +Hope this helps someone. I haven't tested much to confirm that this doesn't +cause any problems, but I can confirm that SpiderOak is semi-running for me (no +bugs yet). + + +Category:Linux + +Category:KDE + +Category:Qt + + +// vim: set syntax=asciidoc: diff --git a/src/Visual_Studio_2010_Debugging_in_Remote_Locations.ascii b/src/Visual_Studio_2010_Debugging_in_Remote_Locations.ascii new file mode 100644 index 0000000..022b28d --- /dev/null +++ b/src/Visual_Studio_2010_Debugging_in_Remote_Locations.ascii @@ -0,0 +1,35 @@ +I was recently writing a server status report program to check the statuses of +servers and produces a text file report (stunning good naming scheme I know) +and I ran into an error that was quite perplexing mostly because it shouldn't +have been happening for various apparent reasons. On launch of a unit test, I +received the error + +---- +Could not load file or assembly 'file:///<insert network drive path here><insert project path here>binDebugsome.dll' or one of its dependencies. +Operation is not supported. (Exception from HRESULT: 0x80131515) +---- + +This is quite the problem since unit testing is a wonderful thing sent down +from God Himself to bless us developers (who ever said God wasn't good?). **The +problem here is that Visual Studio won't load in untrusted assemblies**, and +assemblies on a networked drive are not considered trusted, *. That being said, +to fix this problem, all we need to do is allow remote sources to be loaded in. +Here's how... + +Open up **C:\Program Files\Microsoft Visual Studio +10.0\Common7\IDE\devenv.exe.config**. Near the top of the configuration file +(mine was line 10) you should see an xml parent of **<runtime>**. Directly +beneath that add *<loadFromRemoteSources enabled="true" />* + +image:files/devenvConfig.jpg[height=300] + +Save and close out *devenv.exe.config* and restart visual studio. On restart, +you should now be able to debug using assemblies in remote locations. + + +Category:Microsoft + +Category:Visual_Studio + + +// vim: set syntax=asciidoc: diff --git a/src/When_Innovation_is_Appropriate.ascii b/src/When_Innovation_is_Appropriate.ascii new file mode 100644 index 0000000..f24fbf5 --- /dev/null +++ b/src/When_Innovation_is_Appropriate.ascii @@ -0,0 +1,119 @@ +When Innovation is Appropriate +============================== +:author: Aaron Ball +:email: nullspoon@iohq.net + +== {doctitle} + +I have recently found myself very burned out on IT. Don't get me wrong, I love +doing anything related to building systems of any kind. I love to design +systems and I love programming (not that those two are very distinguishable). +Modular design that implements seperation of concerns well is like poetry to +me. All that goes to say that I still enjoy working with computers in most +capacities. What's really burned me out is the constant fight. + +I work in a heavily regulated industry with a team that is made up of half +Linux guys and half AIX/IBM guys. I find that the Linux engineers are fighting +with the AIX guys about ways to do things. They don't want to use any product +that doesn't come with an enterprise support package (IBM support is +preferable). They always give the excuse "Well do you want to be the one at +3:00 in the morning who's trying to figure out some obscure problem by yourself +with management breathing down your neck, or do you want a third party who you +can point the finger at and send a ticket to?". The thing about that mentality +though is that pointing the finger at a vendor doesn't get your systems up any +faster, nor does it better you as an engineer. + +I disagree with this mentality (as evidenced with this post). My feelings on +the matter are that my employer is paying me money to be the best at my job +that I can be. That goes without saying that it brings me tremendous +satisfaction to be great at my job. That means learning to support whatever +weird stuff is already in place and engineering better solutions for the ones +that break. After all, why bandage a problem when you can solve the problem all +together. + + +[[two-schools-of-thought]] +== Two Schools of Thought + +All this goes to highlight two different mentalities (yes, I know how cliche +this sounds). One group of people asks "why", and the other asks "why not". + +The "why" people will often look at a problem and think only inside the box the +problem's circumstances provide. If an outside the box solution is considered, +that solution is likely only inside of another box (from one proprietary +solution to another). They consider outside the box thinkers to be reckless and +"cowboy" because outside the box in many cases entails making ones own +solution. + +The other group, the "why not" folks, tend to view the "why" people as closed +minded and paralyzed with indecision. They mentally roll their eyes when they +hear the phrase "enterprise support" and often look at budgets and say "Why are +we paying so much money when we can do such simple work for free". + +Granted, these are generalizations of course. Not all of the above mentalities +apply globally and neither do they apply in their implied levels. These +attitudes are spectrums and do not accurately describe everyone in either +group. + + +[[i-personally...]] +== I Personally... + +When I see a problem at work, my first reaction is not to look for a paid +solution that's going to cost loads of money and make finding employees with +experience with the solution harder. The way I view it, if you pay for a +software so expensive that only a fortune 200 has the resources to buy it, you +are limiting your pool of hireable people down to those who have ever worked at +a fortune 200. Instead I go in search of an open source product that is +established well enough to be able to handle the problems we throw at it (eg: +puppet, apache, clustered mariadb, openstack, kvm, native Linux tools, etc). If +one does not exist and the problem is still surmountable without needing an +entire development team, I try to build my own solution using design best +practice and then I document it like my job depends on it (code comments, class +architecture design documents, database schema design documents, etc). The way +I see it, building my own solutions gives me better understanding of how +already existing solutions work. It also helps because it gets me to research +better ways to do something. From the business' perspective though, they need +to find a developer to maintain my product when I am gone, so in these cases an +enterprise solution might be better. + + +[[a-short-list]] +== A Short List + +Here's a short list of people and companies who have asked why not (notice how +they're all world renound innovators)... + +Google is [seemingly] one of those companies who has a lot of people working +for it that ask why not. They are experimenting with low traffic server farms +that use ARM processors to save on electricity. Twitter is built on Ruby, an +open source language, because it actually can do the job and do it well (why +not when the alternative is licensing IIS, Windows, MsSql and using .Net). +Facebook (despite the problems I have with them) is built on PHP and when that +wasn't fast enough for them, they built their own php to c++ converter. The +Linux kernel which now runs the majority of the servers on planet earth is +built by people sitting at their jobs and at home, donating their time because +the alternatives aren't good enough, and again, why not? OpenStack is used and +developed by NASA, an organization who has safely sent people to space and +back, and Rackspace, one of the biggest hosting providers in the world. +Wikipedia, one of most frequently visited websites in the world, is built for +free on PHP and MariaDB because again, why not? Have you ever seen Wikipedia +crash? The http://en.wikipedia.org/wiki/Lustre_%28file_system%29[Lustre +filesystem] is an open source load balanced filesystem that runs 60 of the +world's top 100 super computers and 6 of the top 10. NASA also uses it. + + +[[in-conclusion]] +== In Conclusion + +It's people asking "why not" that brought us things like HTTP, SSH, Apache, pgp +encryption, multithreading, fiber and copper communications, radio-based +networking (WiFi), and so much more. I seriously doubt that I will ever make +anything nearly as cool or world shaping as +http://www.goodreads.com/quotes/10286-if-i-have-seen-further-it-is-by-standing-on[the +work upon which everything I have made is built], but I can at least try in the +effort to not perpetuate bad methodologies and maybe contribute if even a +little to the knowledge base that is so readily available to all of us. + + +// vim: set syntax=asciidoc: diff --git a/src/Whitelist_MediaWiki_Namespaces_with_$wgWhitelistRead.ascii b/src/Whitelist_MediaWiki_Namespaces_with_$wgWhitelistRead.ascii new file mode 100644 index 0000000..1bd597d --- /dev/null +++ b/src/Whitelist_MediaWiki_Namespaces_with_$wgWhitelistRead.ascii @@ -0,0 +1,189 @@ +Whitelist MediaWiki Namespaces with $wgWhitelistRead +==================================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +MediaWiki is designed for the most part to be an open document repository. In +most setups (presumably), everyone can read and only registered users can edit. +However, permissions can't get much more granular than this. For my project at +least, I would like to not just limit anonymous users from editing, I would +like to selectively limit them from reading certain things. + +I looked around for quite some time until I came upon a variable you can set in +your LocalSettings.php file: **$wgWhitelistRead**. Basically, this variable +whitelists the pages specified in the array. The downside to this is you can't +use wildcards or namespaces/categories. You must specify a single page per +array value. This doesn't quite cut it for my needs. That being said, here's my +solution (albeit rough). + +The end goal here looks like this... + +* All users are blocked from reading and writing all pages +* Users in all groups are then given read access to the whitelisted namespaces +* Finally, users in the specified groups have read and write access to all + pages (save for the administration/sysop pages of course). + + +[[limiting-all-access]] +== Limiting All Access + +To do this, in your LocalSettings.php file, place the following four lines... + +---- +$wgGroupPermissions['*']['read'] = false; +$wgGroupPermissions['*']['edit'] = false; +$wgGroupPermissions['user']['read'] = false; +$wgGroupPermissions['user']['edit'] = false; +---- + + +[[granting-sysop-access]] +== Granting Sysop Access + +Once you have the lines in the last section in your config file, your entire +wiki should be unavailable, even to sysop people (they are users after all). To +give access back to your sysop folk, place the following two lines in your +LocalSettings.php file + +---- +$wgGroupPermissions['sysop']['read'] = true; +$wgGroupPermissions['sysop']['edit'] = true; +---- + +This will only grant access to your sysop authenticated users. If they're not +already authenticated, they still can't get to the Special:UserLogin form +(we'll get to that in just a few) to login. They may be sysops at heart, but +hearts don't authenticate people without usernames and passwords. + + +[[granting-individual-group-access]] +== Granting Individual Group Access + +Now that our sysops have permissions, next we need a custom group so we can +grant permissions to them. We'll call that group 'GreenTea' (yes, I'm drinking +some green tea right now). To do that, let's throw another few lines in the +LocalSettings.php file... + +---- +$wgGroupPermissions['greentea'] = +$wgGroupPermissions['user']; $wgGroupPermissions['greentea']['read'] = +true; $wgGroupPermissions['greentea']['edit'] = true; +---- + + +[[granting-minimal-global-permissions]] +== Granting Minimal Global Permissions + +Now that our group is set up, we need to whitelist the necessary and wanted +pages for anonymous folk to log in and/or do their thing depending on what +groups they are in. To do this, let's add yet another few lines to our +LocalSettings.php file + +---- +$wgWhitelistRead = array( + 'Main Page', + 'Special:Userlogin', + 'Special:UserLogout', +); +---- + +What we just did was whitelist the main page, the login page, and the logout +page. This allows users to get in and out of your wiki, whether or not their +permissions allow them access to anything. At this point, you can log in with +your sysop user and put people into our previously created 'greentea' group. +Once that's done, the greentea users should have full access to the entire +wiki. + +I would like to note here that that this point, users outside of the greentea +group will have the same permissions as anonymous/unauthenticated users. They +cannot read or edit any pages other than the ones currently whitelisted. + + +[[editing-mediawiki-to-whitelist-namespaces]] +== Editing MediaWiki to Whitelist Namespaces + +This is the only part that's out of the ordinary here. We are going to edit +actual MediaWiki code. The big downside to doing this is that if the MediaWiki +instance is upgrade, it is highly likely that the changes made in this section +will be overwritten. Thankfully though, the changes are very simple, so making +them again shouldn't be a problem. They're so simple in fact, I think the +MediaWiki folks might actually accept my code into their branch. + +To set up our MediaWiki instance so it handles regex whitelist statements, we +need to edit the Title.php file in the includes directory. + +Firstly, we need to comment out the code that processes the whitelist variable. +Head to around line 1870 in Title.php and comment out just the following lines + +---- +//Check with and without underscores +if ( in_array( $name, $wgWhitelistRead, true ) || in_array( $dbName, $wgWhitelistRead, true ) ) + return true; +---- + + +Now that those have been commented out, we need to add in the code that will +process regex statements in the whitelist array. Below the lines you just +commented out, add the following code... + +---- +foreach ( $wgWhitelistRead as $item ) + if ( preg_match( '/^'.$item.'$/', $name ) + || preg_match( '/^'.$dbName.'$/', $name ) ) return true; +---- + + +[[usage]] +== Usage + +To use the changes we just put in place, all that needs to be done is edit the +$wgWhitelistRead variable in LocalSettings.php again. + +Say, for example, that we have a 'HowTo' namespace ('HowTo:Drink Green Tea' for +example) that we want everyone to be able to read that isn't in the greentea +group (they have to learn somehow after all). All that needs to be done is a +little regex... + +---- +$wgWhitelistRead = array( + 'Main Page', + 'Special:Userlogin', + 'Special:UserLogout', + 'HowTo:.*', +); +---- + +That just whitelisted all pages inside the 'HowTo' namespace. + + +[[a-bad-explanation-attempt]] +== A Bad Explanation Attempt + +In case anyone who doesn't know is wondering why you put a *.** at the end of +the HowTo namespace, here you go. + +In regular expressions, various symbols have different meanings. In this case, +the period signifies any case letter, number, symbol, etc. That means that +'HowTo:.' would match anything like 'HowTo:A', 'HowTo:3', 'HowTo:-', etc. It +would however not match 'HowTo:A123'. Why? The period in regular expressions +matches only one character. What we need is to say match any character any +number of times after 'HowTo:'. For that we'll need the asterisk. + +The asterisk in regular expressions is what we call a quantifier. It doesn't +represent a character so much as a quantity. In non regex terms, an asterisk +means that the previous character in the regex string can be repeated zero or +more times and still match. That means that the regular expression 'c*' would +match nothing, 'c', 'cccc', 'cccccc', etc. It would however not match for +example, 'b', '5', '12345a', etc. In our example, 'HowTo:.*', the period +represents any character and it is followed by an asterisk, so that means that +any article that starts with 'HowTo:' will match, no matter what the ending, +even if it doesn't have one. + +Hopefully someone finds this post useful. If anyone has questions about *.** +please ask them in the comments. + + +// vim: set syntax=asciidoc: diff --git a/src/XMPP_Error:_404:_Remote_Server_Not_Found.ascii b/src/XMPP_Error:_404:_Remote_Server_Not_Found.ascii new file mode 100644 index 0000000..f5ffff5 --- /dev/null +++ b/src/XMPP_Error:_404:_Remote_Server_Not_Found.ascii @@ -0,0 +1,66 @@ +XMPP Error: 404: Remote Server Not Found +======================================== +:author: Aaron Ball +:email: nullspoon@iohq.net + +== {doctitle} + +I recently moved myself away from yet another Google service (nothing against +you Google I just like having control over my stuff) and am now running my own +XMPP server. I have a rather interesting situation though. Since I use Google +Apps, I already had Google Talk set up for my domain. This wasn't too bad a +problem since you can just disable that. The real problem arose when I tried +to create my XMPP server on a server not directly referenced by my DNS A +records. We'll say the server is located at chat.bitnode.net for this example. + +The issue arose that when I configured the server so the users' addresses were +user@bitnode.net instead of user@chat.bitnode.net. When I had the users names +@bitnode.net, I received the error + +---- +404: Remote Server Not Found +---- + +on all of my friend requests. At first, I thought that was because my jabber +server couldn't talk to the Google server where my friend's accounts were +located. Then I realized (unfortunately hours later), that it was an error +being returned by Google's servers because they couldn't find MY server at the +location the usernames indicated (IE: bitnode.net). My guess is this has +something to do with server dialback. + +So, a quick rundown of where we are to make sure we're all on the same page... +An example of a username is jimminy@bitnode.net. The jabber server is located +at chat.bitnode.net. The username indicates that the chat server is located at +bitnode.net, which is not the case. + +Now the problem is pretty obvious. The _404: Remote Server Not Found_ error is +because Google's jabber servers are looking at bitnode.net when the server is +located at chat.bitnode.net. + +Thankfully, the solution is relatively simple to implement, but it does +require access to DNS for your domain. **The solution here is to put a +few DNS SRV records in**. Due to the fact that everyone's setup is +different, I will use the default ports for my SRV strings. + +---- +_xmpp-client._tcp yourdomain.net 5 0 5222 fqdn.to.server.net +_xmpp-server._tcp yourdomain.net 5 0 5269 fqdn.to.server.net +---- + +So what we are saying here (at least my understanding of it is) that if an xmpp +connection (_xmpp-server._tcp) tries to connect to yourdomain.net on port 5269 +, the traffic is seamlessly sent to fqdn.to.server.net. Some additional info, +the 5s are priority and the 0s are weight. + +With that, wait fifteen or so minutes for the changes to the master zone to +take effect and give it a try. This _should_ fix the issue with all of the +jabber servers out there, but I have only tried this on ejabberd and OpenFire +so far. + +I hope this helped someone out. Please let me know in the comments if anyone +has any questions. + +Category:DNS Category:XMPP + + +// vim: set syntax=asciidoc: diff --git a/src/Xfce_4.10_Pre_2_Review.ascii b/src/Xfce_4.10_Pre_2_Review.ascii new file mode 100644 index 0000000..fc47224 --- /dev/null +++ b/src/Xfce_4.10_Pre_2_Review.ascii @@ -0,0 +1,66 @@ +Xfce 4.10 Pre 2 Review +====================== +:author: Aaron Ball +:email: nullspoon@iohq.net + + +== {doctitle} + +Four days ago on April 14, 2012, http://xfce.org[Xfce] 4.10 pre 2 +http://xfce.org/about/news/?post=1334361600[was released]. It's been a while +since 4.8 was released, so let's see how it's going. + +I'll just start out with this summary. Overall I'm not super impressed +with this release so far. Don't get me wrong, I'm very excited for the +release and I completely support the Xfce guys. They're doing good work. +My only real complaint for this release is simply the amount that came +with it. There just doesn't seem to be that much new stuff. There were a +lot of bug fixes and translation updates though and for the most most +part, it's pretty stable. + +Now, with that out of the way, let's take a look at a few screenshots of some +new stuff I found. Before we do that though, I'm using the Orta theme with the +AwokenWhite icons. Additionally, my panel is set to alpha 0, so the fancy +integration into my background is not a part of Xfce 4.10. + +Alright, now to screenshots + +____ +image:files/00-desktop.jpg[height=400,link="files/00-desktop.jpg"] +Here we've got just a view of the desktop. Nothing notably different here other +than the top right where the you can see the blurred out text. That would be my +username. We now have a user actions widget. +____ + +____ +image:files/02-xfce-user-actions.jpg[height=300,link="files/02-xfce-user-actions.jpg"] + +So here is the user actions button. There are more settings to add more stuff +to this menu. I'm just using the default. +____ + + +____ +image:files/01-xfce-settings.jpg[height=400,link="files/01-xfce-settings.jpg"] + +Here is the Settings window. The Xfce devs have added categorization to it now. +You'll also notice at the bottom the "Settings Editor". That's kind of like +Gnome's gconftool. It seems to have granular settings for Xfce. Most of them +are just settings you can edit through the Settings dialog. +____ + +____ +image:files/03-xfce-window-resize-hot-edge.jpg[height=400,link="files/03-xfce-windows-resize-hot-edge.jpg"] + +And finally we have some functionality that I've been hoping for for some time +now. Hot edges for resizing windows. Here I drug the terminal to the top and it +auto resized to half of my screen. I drug the file manager to the bottom and it +resized to half of the bottom of my screen. It also works on the left and right +sides, but for that you have to set your workspace count to one unfortunately. +____ + + +Category:Linux +Category:XFCE + +// vim: set syntax=asciidoc: |