[Quick Links] |
Search Site

Site Details

rendered in 0.0671 secs

Captain's Log | Wednesday 15th of July 2015

book review: The Pragmatic Programmer
It was like a pocket edition of "Code Complete". A lot less pages, not as much reasoning behind the whys but still very good. If you had to choose one or the other I'd go for "Code Complete", as this book reiterates a lot that's already said there however you get the reasoning behind the choices a lot more with "Code Complete".
how do you lock mint MATE on boot (I have auto login enabled you see) | src
You may find a command online to lock it up from bash and then drop it into startup applications and wonder why it's not working; I did.
cat /home/rick111/111/scripts/lock_mate.sh
#!/bin/bash
mate-screensaver-command -a

chmod +x /home/rick111/111/scripts/lock_mate.sh

Now add this to "startup applications":
bash -c "sleep 5; /home/rick111/111/scripts/lock_mate.sh"What would a PHP test look like using phpunit?
class TestAll extends PHPUnit_Framework_TestCase {

    public function testRemoveWhiteAndEmpty() {
        if(!defined('BASEPATH')) {
            define('BASEPATH', 1);
        }
        require_once('arrayahoylib.php');

        $array_with_whiteshite = array(
            1 => "one",
            2 => " two with space at start",
            3 => ""
        );
        $classUnderTest = new ArrayAhoyLib();
        $array_with_whiteshite = $classUnderTest->removeWhiteAndEmpty($array_with_whiteshite);

        $this->assertArrayNotHasKey(3, $array_with_whiteshite);
        $this->assertStringStartsNotWith(' ', $array_with_whiteshite[2]);

    }  
}



Captain's Log | Wednesday 8th of July 2015

How can I use my ssh cert to authenticate rather than a password?
make sure you use quotes if you want to use a port other than 22. in this example we use port 111.
ssh-copy-id "user@123.45.56.78 -p111"
if you get an error that no identities exist, create one with
ssh-keygen -t rsa
Is there anything like treesize for linux? - srcsudo vim ~/bin/treesize
#!/bin/bash
du -k --max-depth=1 2> >(grep -v '^du: cannot \(access\|read\)' >&2) | sort -nr | awk '
     BEGIN {
        split("KB,MB,GB,TB", Units, ",");
     }
     {
        u = 1;
        while ($1 >= 1024) {
           $1 = $1 / 1024;
           u += 1
        }
        $1 = sprintf("%.1f %s", $1, Units[u]);
        print $0;
     }
    '
:wq
sudo chmod +x ~/bin/treesize
  then just type treesize in whatever dir you'd like to inspect

I need to restart apache after rebooting my laptop to get it to register the virtual hosts correctly, got any pokes?sudo vim /etc/rc.local
sleep 10
service apache2 restart
exit 0 make sure this is the final line the file
:wq

This is due to a race condition where your web server initializes quicker that your network interface.

Captain's Log | Sunday 5th of July 2015

local apache2 server not working with sslopenssl s_client -connect localhost:443
connect: Connection refused
connect:errno=111

sudo a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
  service apache2 restart

sudo service apache2 restart
openssl s_client -connect localhost:443
CONNECTED(00000003)
depth=0 CN = mint
verify error:num=18:self signed certificate
verify return:1
depth=0 CN = mint
verify return:1
starting enable remaining boot-time encrypted block devices
bad fstab entry, pound some keys until it boots; I waited a while and then just went postal on the middle of my keyboard and it booted.
sudo vim /etc/fstab
#comment out potential bad entry
sudo reboot
How can I compare two files in vim? (diff) | I use vim plugin diffchar.vim to make the output clearervim -d file1.php file2.php
F7  to then tab between compare modes
How can I add a ppa repository?sudo add-apt-repository ppa:
sudo apt-get update

to remove a ppa
# find the correct ppa file to delete by listing all ppa files:
ls /etc/apt/sources.list.d

# delete the ppa that you would like to remove:
sudo rm /etc/apt/sources.list.d/some-ppa-to-remove.list
sudo apt-get update
optimise fedora 21 for laptop battery savingsu
crontab -e
* * * * *       for x in /sys/devices/system/cpu/cpu[0-3]/cpufreq/;do    echo 500000 > $x/scaling_max_freq; done #locks cpu to 800Mhz which usually resets if you come out of suspend or anything
:wq
tuned-adm profile powersave



Captain's Log | Sunday 5th of July 2015

How do I set the brightness on my laptop at boot programmatically? | intel mint 17
I had an issue where whenever I set the brightness on my laptop and rebooted it would reset back to maximum. Now even with the below command I was having an issue whereas it would reset back to max brightness after a minute or two. This is because in the power settings under battery it was set to "dim" the display. This auto dimming compared to the max brightness setting when on power was resetting the changes we make below at boot, so make sure to turn off "dim display" in power management when running on battery.

And then you can edit the file below which is ran automatically at boot by root:
sudo vim /etc/rc.local
echo 337 > /sys/class/backlight/intel_backlight/brightness
  make sure the above is before the final "exit 0"
:wq
Got any of those horizontal scrolls using a touchpad?
In mint 17.1 it was only showing the touchpad as a mouse and only vertical scrolling was working. To get vertical scrolling working it took the updating of the kernel. This was after trying many apps and ideas in the 17.1 (3.13) kernal. As soon as I updated to 13.18 and made a couple of changes under the new touchpad options on the control centre, everything was working as expected.

I'm not going to demo code for update as the wget location is changing all the time and it's done that way rather than via apt-get install. It involved:
  • download 3 files headers/headers generic/image generic
  • install all 3
  • update grub
  • reboot
example 1example 2


Captain's Log | Thursday 25th of June 2015

How to download sage updates without having to login to the portal?Show me the moneyBonus info:
Sage 2015 company file | src


Windows XP Sage 2015 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2015\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2015 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2015\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2015 Company File Location:
C:\ProgramData\Sage\Accounts\2015
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2015 Company File Location:
C:\ProgramData\Sage\Accounts\2015
(Note this folder is hidden (program data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2015 Company File Location:
C:\ProgramData\Sage\Accounts\2015
(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"

Sage 2014 company file

Windows XP Sage 2014 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2014\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2014 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2014\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2014 Company File Location:
C:\ProgramData\Sage\Accounts\2014
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2014 Company File Location:
C:\ProgramData\Sage\Accounts\2014
(Note this folder is hidden (program data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2014 Company File Location:
C:\ProgramData\Sage\Accounts\2014
(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"

Sage 2013 company file

Windows XP Sage 2013 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2013\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2013 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2013\
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2013 Company File Location:
C:\ProgramData\Sage\Accounts\2013
(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2013 Company File Location:
C:\ProgramData\Sage\Accounts\2013
(Note this folder is hidden (program data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2013 Company File Location:
C:\ProgramData\Sage\Accounts\2013
(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"


Sage 2012 company file


Windows XP Sage 2012 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2012\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2012 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2012\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2012 Company File Location:
C:\ProgramData\Sage\Accounts\2012

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2012 Company File Location:
C:\ProgramData\Sage\Accounts\2012

(Note this folder is hidden (program data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2012 Company File Location:
C:\ProgramData\Sage\Accounts\2012

(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View >  Hidden Files & Folders > "Show hidden files and folders"

Sage 2011 company file


Windows XP Sage 2011 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2011\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2011 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2011\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2011 Company File Location:
C:\ProgramData\Sage\Accounts\2011

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2011 Company File Location:
C:\ProgramData\Sage\Accounts\2011

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2011 Company File Location:
C:\ProgramData\Sage\Accounts\2011

(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"


Sage 2010 company file


Windows XP Sage 2010 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2010\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2010 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2010\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows Vista Sage 2010 Company File Location:
C:\ProgramData\Sage\Accounts\2010

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2010 Company File Location:
C:\ProgramData\Sage\Accounts\2010

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2010 Company File Location:
C:\ProgramData\Sage\Accounts\2010

(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"


Sage 2009 company file

Windows XP Sage 2009 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2009\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 2003 Sage 2009 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2009\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"
Windows Vista Sage 2009 Company File Location:
C:\ProgramData\Sage\Accounts\2009

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 7 Sage 2009 Company File Location:
C:\ProgramData\Sage\Accounts\2009

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2009 Company File Location:
C:\ProgramData\Sage\Accounts\2009
  
(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"


Sage 2008 company file

Windows XP Sage 2008 Company File Location:
C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2008\

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"
Windows Vista Sage 2008 Company File Location:
C:\ProgramData\Sage\Accounts\2008

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"
Windows 7 Sage 2008 Company File Location:
C:\ProgramData\Sage\Accounts\2008

(Note this folder is hidden (application data) by default in Windows... Go to Tools>Folder Options> View > Hidden Files & Folders > "Show hidden files and folders"

Windows 8 Sage 2008 Company File Location:
C:\ProgramData\Sage\Accounts\2008
  
(Note this folder is hidden (program data) by default in Windows 8... Open Explorer > Select the C drive > Go to View at the top > Options on the right hand side > View > Hidden Files & Folders > "Show hidden files and folders"


Sage 2007 company file or older

C:\Program Files\Sage 2007\Accounts

The default data paths have changed in Sage 2008 and 2009. They are now set depending on the OS.

In pre Sage 2008 versions the Company file was in the Sage Program Folder. The actual data would be in a subfolder of the Program Folder i.e.