Thursday, April 2, 2015

Ubuntu 15.04 Broken Upstart / Working Systemd

Ubuntu 15.04 I believe has switched over to upstart which in turn has broken more then a few 3rd party apps I had installed.

For example whenever I tried to install plex media server I would get the following error:

"initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused"


Here's the fix that worked for me:

sudo dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

Credit for this little tweak: https://www.nesono.com/?q=node/368


Sunday, June 1, 2014

Raid 5 to ZFS (Part 3 )

I posted a few articles in the past on migrating from Raid 1 to Raid 5. This will be my attempt to migrate from a raid 5 system to ZFS.

Setup

sudo apt-add-repository --yes ppa:zfs-native/stable
sudo apt-get update
sudo apt-get install ubuntu-zfs
Validate that the module was load.
sudo modprobe zfs
sudo dmesg | grep ZFS
Expected output should be something along these lines:
[  824.725076] ZFS: Loaded module v0.6.1-rc14, ZFS pool version 5000, ZFS filesystem version 5
This should get you all you need to create a standard ZFS setup. If you're starting from a clean slate, follow this guide. I'll follow it as a guide, though my plan is to shift from Raid 5 to ZFS. (Naturally backup, backup, backup....oh and did I mention backup? Okay good).

Thursday, March 13, 2014

Mesos on Ubuntu 13.10 Part 1

This is my experiment to get mesos setup on Ubuntu.  Think of mesos as an layer running on top of your native OS that manages the machine's resources.  You can then request and allocate resources as needed.  This is just a blog post where I went through the steps and got master setup to run on an Ubuntu Server.

Install instructions come from:  http://mesos.apache.org/gettingstarted/

Install Dependencies.


sudo apt-get update
sudo apt-get install build-essential openjdk-7-jdk python-dev python-boto libcurl4-nss-dev libsasl2-dev autoconf libtool 

Build Mesos

    # Change working directory.
    $ cd mesos

    # Bootstrap (***Skip this if you are not building from git repo***).
    $ ./bootstrap

    # Configure and build.
    $ mkdir build
    $ cd build
    $ ../configure
    $ make -j

    # Run test suite.
    $ make -j check

    # Install (***Optional***).
    $ make install

Examples

 
# Change into build directory.
 $ cd build

 # Start mesos master.
 $ ./bin/mesos-master.sh --ip=127.0.0.1

 # Start mesos slave.
 $ ./bin/mesos-slave.sh --master=127.0.0.1:5050

 # Visit the mesos web page.
 $ http://127.0.0.1:5050

 # Run C++ framework (***Exits after successfully running some tasks.***).
 $ ./src/test-framework --master=127.0.0.1:5050

 # Run Java framework (***Exits after successfully running some tasks.***).
 $ ./src/examples/java/test-framework 127.0.0.1:5050

 # Run Python framework (***Exits after successfully running some tasks.***).
 $ ./src/examples/python/test-framework 127.0.0.1:5050

Sunday, March 17, 2013

Cloud Security Encryption

I've started using Google Drive under Linux with the automatic sync being provided by InSync.  One of my concerns, like most people is security.  Like with any security system, the more security it is the less convenient it is.  You gain more security by sacrificing more conveniences.

ie.  The most secure storage, is a turned off computer put in a safe.  (it's secure and utterly useless).

My first approach is a bit less secure, but fairly convenient.

1.  InSync basically lets me sync files to supposedly multiple Google Drive accounts, though I still have to figure out the exact procedure for that.  For now, I drop a file in $HOME/Insync/account_name/ and it magically appears in my google drive.  Some files, say bills, and tax records I might not want to put on my google drive.

Approach A


I decided to keep all my files as pdfs.  So, all I need to do is figure out a way to encrypt them.  I decided to use pdftk which is pretty much the best tool kit I've found for manipulating PDFs.

Here my steps:
1.  Scan / place file into a non-cloud enabled location.  Let's call this $HOME/tmp/ and call the file open.pdf
2.  Encrypt the file.

     pdftk $HOME/tmp/open.pdf output encrypted.pdf owner_pw s3cr3t
     naturally, replace s3c3t with your own password.
3.  move file to your synchronized 'folder' where it will be kept.

Advantages:
  • Qausi secure.  128bit encryption on pdf files.
  • Google understands encrypted files, and will prompt you for your password when trying to open your pdfs.  Which means, you can open and view your secure files via any web browser.
Disadvantages:
  • 128Bit encryption is inconvenient to break, but not impossible.  If you're storing important information.. like say your tax records with your SSN, you probably want something more secure.

Approach B

This approach was intended to take advantage of boxcryptor.  I was following an old guide for this service to allow for linux support, though right now, I really can't see a reason to use them, since as far as I can tell, a native Dropbox/ Google Plus client + encfs will provided essentially the same benefits.

Directions:

1.  We'll be relying on encfs.  I think cryptkeeper is supposed to be a nicer more user friendly way of doing this, but I could figure out how to use it, or cared enough to look into it, so we'll be doing this the CLI way.

sudo apt-get install encfs
sudo apt-get install cryptkeeper #optionally 

2.  we'll call your sync folder "cloud", replace this with ~/Dropbox, ~/insync/username/ or whatever is appropriate in your case.

cd ~/cloud
mkdir ~/temp_cloud
mv ~/cloud/* ~/temp_cloud  # moving all files out of cloud storage

3.  This will probably delete all your 'cloud' storage, but that's okay.  We just moved the files out into a local folder.  If you're doing this with gigs and gigs of data...this might take a while.

4.  Mount your ~/cloud as an encrypted folder

encfs ~/cloud ~/secure_storage  #I just used p for default settings and entered a nice long password.
mv ~/temp_cloud/* ~/secure_storage/

5.  Enabling automatic mounting of ~/cloud 

sudo apt-get install  libpam-mount
sudo gpasswd -a USERNAME fuse
sudo vim /etc/security/pam_mount.conf.xml
insert a line resembeling this one right below:

<!-- Volume definitions -->
        <volume user="user" fstype="fuse" path="encfs#/home/user/secure_storage" mountpoint="/home/user/cloud" />

6.  Reboot, and your drive should be automatically mounted.  Now IF you want to ensure that the file is encrypted then you should only be working in the folder ~/secure_storage.  Any files you create in ~/cloud directly will be plaintext and in-secure.

Advantages:
  • Much higher lever of security then anything a PDF crypto will provide.
  • Pretty much transparent.  You could also configure your cloud app to look at ~/crypto and mount ~/Dropbox (for example).  essentially switching the order.  
Disadvantages:
  • All the files are utter garbage via a web browser.
  • Main big issue I have right now, is there seem to be a file name limit.  You can't have a file name longer then 36 characters.  


References

  1. http://pragmattica.wordpress.com/2009/05/10/encrypting-your-dropbox-seamlessly-and-automatically/   (Prettier version of Approach B I found while looking up stuff as I was writing this document) 

Wednesday, December 19, 2012

Social Media History Clean Up

I'm not sure if anyone would find this useful, but made a very green alpha release of a pet project I had for a while.


I was getting annoyed with twitter and other social media when I wrote this.  I mainly wrote a social media finger print cleanup.  It asks for permission and will flush out your entire twitter minus two weeks delay.  

So if I ran this today, 12/19/2012, then any post I made that was on or before 12/04/2012 would be deleted. 

I know it needs to be a lot more configurable .and I have several todo items associated with this project.  I'm just curious to know if anyone would find it useful.


Thursday, November 22, 2012

Netflix On Ubuntu

Disclaimer: Full credit for this article goes to:  http://www.omgubuntu.co.uk/2012/11/how-to-use-netflix-on-ubuntu  This is nothing but a repost.

I usually post random tech items and a few other oddities that interest me...and netflix coming to the Linux Desktop has me super excited.

1.  Install Netflix Desktop



  • sudo apt-add-repository ppa:ehoover/compholio
  • sudo apt-get update && sudo apt-get install netflix-desktop
2.  start netflix-desktop and follow the screen prompts.  It should download the gecko engine, install silverlight etc.... and you should be able to stream your netflix videos.

If you do get this working.. I am curious to see what the performance is for you.  It looks like it runs.. but it's definitely not native.  A step in the right direction though....

On a side note.  There is this big project spiraled by Ubuntu where they're trying to get Ubuntu running on an android phone.  I wonder if the opposite would be possible, and if we'll ever see a native Android app run on an Linux Desktop.  (Letting me run my android netflix app on my 24" LCD monitor ) 





Wednesday, November 21, 2012

Changing Default / Primary Monitor in Gnome 3

The proper way to do this is to run System Settings -> Display and drag the black bar at the top of your primary monitor to another monitor.  I find the Display interface really difficult to use and unresponsive.

So, as much fun as it is to try to get that UI to work, this is my work around using the CLI.

list all your monitors:

xrandr  

This will list the IDs of all your current monitors.  To set a different monitor as the default type something along these lines:

xrandr --output HDMI3 --primary

where HDMI3 is the ID of the monitor you want set as your primary monitor.