PivotX Powered » My webloghttp://coderkris.com/
Welcome to your new online presence!encoder.kris@gmail.com (kris)Copyright 2019PivotX - 2.3.11Mon, 21 Jan 2019 14:26:59 -080060Git Merge !!http://coderkris.com/archive/2017-11-12/git-merge-
http://coderkris.com/archive/2017-11-12/git-merge-#comm ]]>32@www.coderkris.com/Funny ShitSun, 12 Nov 2017 13:59:00 -0800krisUpdating LXC Containers Using do-release-upgradehttp://coderkris.com/archive/2014-12-12/updating-lxc-containers-using-do-release-upgrade
http://coderkris.com/archive/2014-12-12/updating-lxc-containers-using-do-release-upgrade#commA while ago i went through the whole rigmarole of updating Ubuntu from a no longer supported version to a supported version and had to go about updating all my LXC containers at the same time. The later part of this mission might have been made easier with the following information.

I completely do not claim any credit for this, i found it here http://slacy.com/blog/2014/10/running-do-release-upgrade-or-apt-get-dist-upgrade-on-an-lxc-container/ which is a repost of http://ubuntuforums.org/showthread.php?t=1295052 and it all certainly worked for me.

The first thing to make sure of is that do-release-upgrade is definatley installed :

sudo aptitude install update-manager update-manager-core

Once this is done then the process is pretty much as follows (as per the above posts) :-

]]>30@www.coderkris.com/LinuxFri, 12 Dec 2014 16:38:00 -0800krisLinux Screen - Reconnect to Disconnected Sessionhttp://coderkris.com/archive/2014-08-09/linux-screen-reconnect-to-disconnection-session
http://coderkris.com/archive/2014-08-09/linux-screen-reconnect-to-disconnection-session#commI quite often use the 'screen' command when i work remotely, mainly to safe guard against losing work from unexpected disconnects.

One of the problems i found though was that when an unexpected disconnect happened, quite often i'd end up with a screen session still attached to a now stale ssh tty, and screen -r would not allow me to reattach to an already attached session, albeit a session attached to a stale/zombie ssh session.

After some googling around, i've found the solution to be using, screen -Dr as oppossed to screen -r ...... essentially it does what ever is nessecary to reconnect to the specified session, or the last session if none is specified.

]]>29@www.coderkris.com/LinuxSat, 09 Aug 2014 05:12:00 -0800krisUbuntu 12.04 LXC Container CurlFTPFS, fuse: mount failed: Permission deniedhttp://coderkris.com/archive/2014-02-10/ubuntu-1204-lxc-container-curlftpfs-fuse-mount-failed-permission
http://coderkris.com/archive/2014-02-10/ubuntu-1204-lxc-container-curlftpfs-fuse-mount-failed-permission#commHad a problem today, where i came to use curlftpfs inside of an LXC container running Ubuntu 12.04 that i had upgraded from some previous version of Ubuntu a while ago, and had not actually needed to use curlftpfs until now.

When ever i tried to mount a remote ftp site via curlftpfs i kept getting the message "fuse: mount failed: Permission denied". After a little bit of investigation and Googling, i found i needed to do the following :-

Inside the container :-

sudo mknod -m 666 /dev/fuse c 10 229

This got SSHFS to work, however, CurlFTPFS was still failing, so after looking at dmesg log, i found the following :-

]]>28@www.coderkris.com/LinuxMon, 10 Feb 2014 04:27:00 -0800krisApache Logs Rough Data Transferhttp://coderkris.com/archive/2014-01-27/apache-logs-rough-data-transfer
http://coderkris.com/archive/2014-01-27/apache-logs-rough-data-transfer#commI needed to figure out how much data transfer one of my clients sites was using today, and after a bit of a headstart from these sites :-

(note: it was a one liner before i multi lined it for formatting purposes here)

The numbers to use for $6 and $15 (field positions you will need to experiment with your log files until you get the right values ( $6 should be the field that contains the date, and $15 should be the field that contains the total bytes transferred )

]]>27@www.coderkris.com/Apache, LinuxMon, 27 Jan 2014 14:15:00 -0800krisGet The Size of MySQL Databaseshttp://coderkris.com/archive/2013-07-03/get-the-size-of-mysql-databases
http://coderkris.com/archive/2013-07-03/get-the-size-of-mysql-databases#commI'm currently dealing with moving a client's web application over to a new host, and one of the hosts that the client wanted me to check out was 1&1. The only problem with 1&1 that i could see was a 1GB limit on database size.

So i needed to check the size of the database right now, and normally, although not accurate, what i would normally do is do mysqldump of the db, and see how large that is. On this occassion though i decided to research if there's a better and more accurate way of doing it.

]]>26@www.coderkris.com/mysqlWed, 03 Jul 2013 14:01:00 -0800krisDual Boot Ubuntu 13.04 / Windows 8http://coderkris.com/archive/2013-06-28/dual-boot-ubuntu-1304-windows-8
http://coderkris.com/archive/2013-06-28/dual-boot-ubuntu-1304-windows-8#commRecently I bought a new laptop with Windows 8 Home installed as default(an Acer V5-471 from Tescos, at an amazingly good price ;) ), though when i came to install Ubuntu WUBI on it, everything went great until i attempted to boot into WUBI. On attempting to boot i got a white on black text error scree pertaining to "wubildr.mbr".

After a bit of research i found that this was down to the new type of boot configuration on new hardware known as UEFI & Secure Boot.

After doing a bit more research i found plenty of posts on the web suggesting that WUBI is not going to work with UEFI, and that installing as a dual boot configuration in a seperate partition was the way to go. Great, brilliant, i'll try that then. The only problem now is that most of these posts all suggest creating a bit of spare space on the disk using the Disk Manager in Windows(shrink the Windows partition some, so that there is some spare space availabe to install Ubuntu into), which is not a problem, however they also all suggested that during the Ubuntu install you should be presented with a number of options for how the install should work, one of which being "Install along side Windows"(words to the effect of), and this option did not display for me !

A bit more research later and i couldn't find any recommendations on how to proceed. Eventually i decided to just attempt what i thought might work instead, and it did, so here's my steps :-

*** MAKE SURE YOU BACKUP FIRST ***

1) Partitioning

Using the windows tool to partition, create some free space on the disk. I shrank the Windows partition by 50gb, which then obviously became available for the install of Ubuntu.

2) Install Ubuntu

First of all make sure to disable Secure Boot. I read one post that claims alot of work was put into Ubuntu 13.04 to make sure it was Secure Boot compatible, however, either Ubuntu 13.04's installer or Boot-Repair(see below) told me that i needed to disable Secure Boot before it would continue. You should be able to do this in your BIOS settings. You don't need to change UEFI settings at all, just make sure Secure Boot is disabled. (note: i've not tried re-enabling Secure Boot now that i've got everything working, maybe you can try this)

I used 64bit 13.04 so i had to install from an SD card being as it was too large to fit onto a normal cd. Either way, either boot from your Ubuntu install SD Card or from the install CD. I'm fairly sure that i booted up the "try ubuntu with out installing" option when i was presented with the option list.

Once booted to a desktop, i connected the wireless network, then started up "Install Ubuntu" from the desktop icon.

The first part of the installer i selected not to download and install updates during installation, and opted to install 3rd party components. (this shouldn't make much difference what you do here)

The next stage of the installer is where alot of posts are saying they see an "Install along side Windows" option, which i didn't and i'm assuming you didn't(otherwise you'd not be reading this blog post). If you don't see the "Install along side ...." option then choose the "something else option" option.

The next stage of the installer should now show you a disk partitioning tool. Here what you will need to do is create one small parition for 'swap', roughly the same size as the ram in your machine(some will tell you 1x the size of your ram, some will say 1.5x and some will say 2x. I'm going with 1x) You will then need to create another parition, using what ever space is free to be assigned to '/' and i chose ext4 as the file system type(i'm sure ext3 or ext2 would be fine to). The final part of this screen asks you where you want to install your bootloader to. I chose to put this on the same partition as / is on. So, look and see what address is assigned to your main root partition (/) (not swap, but the other one you just created) and see what the partition address is, it will look something like /dev/sda4. Once you know the partition address, select it in the choices of location to install the bootloader to. (i chose to install it on my / partition to avoid destroying any other loaders on the disk's partitions - it left me then with half a chance to back out if i needed to)

Once this is done, continue through the installer, and reboot when you're prompted to

3) Boot Repair

After rebooting you should be booting into Ubuntu no problem at all, however you may find that you're not able to boot into Windows any longer, either because you're not getting to the grub menu, or because the option is not availabe in the grub menu.

If you're not able to see the grub menu then the way to fix this in 13.04 is to either hold down SHIFT whilst booting up, which should make the grub menu appear, or failing this edit /etc/default/grub and comment out (prefix with a #) the line that reads "GRUB_HIDDEN_TIMEOUT=0" ... now your grub menu should apppear at start up.

If Windows or the Windows Boot Loader is not showing in the grub menu then the boot-repair is a tool i found recommended on various posts. To install do the following in a terminal window :-

Next you need to start this up either from a terminal window by typing boot-repair, or from the Unity Launcher. Once it's up and running just hit 'apply'(i think it detects and sets all recommended settings - it did for me) and follow the rest of the instructions(it will ask you to run some sudo commands in terminal - possibly if we'd started up boot-repair from terminal with 'sudo boot-repair' it might not even prompt for you to run these commands)

Once complete, when prompted to restart, do a restart

DONE !

(after you've checked if you can boot into both Ubuntu and Windows, and everything seems good, you could try re-enabling SecureBoot and checking if it's still good - i've still yet to do so, it doesn't really bother me it not being enabled)

]]>25@www.coderkris.com/LinuxFri, 28 Jun 2013 06:24:00 -0800krisUbuntu - OpenVPNhttp://coderkris.com/archive/2013-06-28/ubuntu-openvpn
http://coderkris.com/archive/2013-06-28/ubuntu-openvpn#commRecently my employer changed it's VPN from being a Windows PPTP connection to an OpenVPN configuration. For Windows users it was no problem, they supplied a preconfigured installation of the OpenVPN client for Windows which worked out of the box.

However, when i came to trying to get up and running on a Ubuntu machine i had a few problems. My employer had supplied me with a .ovpn config file that i was supposedly going to be able to just give to Ubuntu and it would work - it didn't.

The is what i had to do :-

1) first of all i had to make sure that the network manager applet was aware of OpenVPN :-

sudo apt-get install network-manager-openvpn

2) next using the network menu from the top right of the Ubuntu desktop i chose VPN Connections > Manage Connections > Import, and selected my .ovpn config file. The import looked to work, however, when i tried to save it the "Save" button was greyed out(disabled) so i couldnt. After a bit of research and trying different things i found that :-

a) remember to make sure any key/crt files referenced in the .ovpn are file are in the same directory as the .ovpn file(or are at the location, relative or absolute, specified) .... otherwise the creation of the vpn connection wont find them, and consquently wont save an incomplete connection. In my case, i had to go get the files from a Windows machine where the Windows client was installed, and copy them into place on the Ubuntu machine.

b) check that if you've set "save" for password, that you have entered a password - again if you've chosen save, and not entered the password, then you'll have an incomplete connection.

I'm sure there's other gotchas with getting this set up, but the above worked for me.