[Quick Links] |
Search Site

Site Details

rendered in 0.0434 secs

Captain's Log | Thursday 18th of June 2015

What's the easiest way to download via ssh?  quick and dirty, dave likes his ssh on port 118 because he's 1337
ssh dave@mygreatsite.com -p118 'cat /path/on/remote.file' > /path/on/local.file
I'm getting spamassassin: sa-update error's on debian for daily cron task. Hey I also use webmin.
Perform this once on you'll have the gas cooking for your future crons:
sudo chown -R debian-spamd:debian-spamd /etc/spamassassin /var/lib/spamassassin
su debian-spamd -c sa-update
How do I format and mount a USB drive on linux from the terminal?sudo fdisk -l
  ...blah
Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 151300095 151298048 72.1G 83 Linux
/dev/sda2       151302142 153356287   2054146 1003M  5 Extended
/dev/sda5       151302144 153356287   2054144 1003M 82 Linux swap / Solaris
  ...blah
Device     Start        End    Sectors   Size Type
/dev/sdb1   2048 1953523711 1953521664 931.5G Microsoft basic data

sudo umount /dev/sdb1
sudo mkfs.ext4 /dev/sdb1
  other volume types you could use with mkfs | mkfs.bfs, mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.minix, mkfs.msdos, mkfs.vfat, mkfs.xfs, mkfs.xiafs
  also ignore the fact if you run fdisk again it says it's type is: Microsoft basic data, it's a fully fledged member of the ext4 club now. don't discriminate.

sudo mkdir /mnt/myDrive
mount /dev/sdb1 /mnt/myDrive
sudo chown $USER /mnt/myDrive/ .   don't forget that little dot at the end there
  now to make it auto mount at boot

ls -l /dev/disk/by-uuid
rwxrwxrwx 1 root root 10 Jun 18 11:34 0bff056e-fd9f-400e-bcf1-56ad1d48ee37 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 18 11:34 56c0e9cb-ca45-43f0-a1ef-9a18cdb2582e -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 18 11:34 e2486625-d2f2-41b5-918c-542a366342fe -> ../../sda5

sudo vim /etc/fstab
  ...
#partington's big fat 1TB storage machine USB thing
UUID=0bff056e-fd9f-400e-bcf1-56ad1d48ee37 /mnt/myDrive auto defaults 0 0
:wq
  reboot if you want to test, other wise you're all done


Captain's Log | Tuesday 16th of June 2015

After using truecrypt to encrypt my drive I'm having issues writing any files to it. It seems like it's stuck in readonlysu
cd /media/wherever whatever so you're at the root of the device
chown -R $USER . don't forget that full stop on the end there
How can I get the mint mate menu style on debian?sudo apt-get update
sudo apt-cache search mint
  find the one that looks like "mate-menu"
sudo apt-get install mate-menu
  once complete add "Advanced MATE menu to your panel"
How can I run a full format (low lowlevel) on my disk?fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
... blah
Device     Boot  Start        End    Sectors   Size Id Type
/dev/sda1  *      2048     499711     497664   243M 83 Linux
/dev/sda2       501758 1953523711 1953021954 931.3G  5 Extended
/dev/sda5       501760 1953523711 1953021952 931.3G 83 Linux
... blah
Disk /dev/sdb: 60.4 GiB, 64826114048 bytes, 126613504 sectors
... blah
/dev/sdb1        2048 126613503 126611456 60.4G 83 Linux
... blah
/dev/sdf1        2048 1953523711 1953521664 931.5G 83 Linux
  We want to format /dev/sdf so next...

dd if=/dev/zero of=/dev/sdf bs=1M


Captain's Log | Wednesday 10th of June 2015

Printer Drivershp x576

Captain's Log | Monday 8th of June 2015

elseif vs Switch Case
My rule of thumb is if you're going to be comparing a single variable it's quicker to use switch. If your comparison statement is going to change for any elseif statement then use elseif.
book review: no place to hide (Edward Snowden and Gleen Greenwald)
Must read for everyone, gives you a good understanding of how governments are trying to stay on top in the digital age. Their job is to protect the country in an age where technological developments are happening so fast and to stay ahead they seem to be making choices first and then pondering the legalities afterwards, or not at all.
How to apply a git patch
cd to the root of the git project
wget the patch file
wget https://github.com/CPIGroup/phpAmazonMWS/pull/48.patch
vim 48.patch

If required change the "a" and "b" paths so they both match the file you are patching, usually there are 4 places this needs to be changed. On the example file it is 2 x instance on line 11 and one instance on line 13 and 14. Save and close.
git apply --stat 48.patch
1 file changed, 3 insertions(+), 2 deletions(-)

This will show you the number of changes, insertions and deletions that would be made but doesn't actually apply the patch. View the actual patch file if you want to see more details of what lines will be changed with what data.
git apply --check 48.patch
Again, no data is changed. If you don't get any output it means the patch will be applied without any known conflicts. And then:
git apply -v 48.patch
Checking patch application/third_party/amazon/classes/AmazonOrderItemList.php...Applied patch application/third_party/amazon/classes/AmazonOrderItemList.php cleanly.
git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

modified:   application/third_party/amazon/classes/AmazonOrderItemList.php

Untracked files:
  (use "git add ..." to include in what will be committed)

48.patch

no changes added to commit (use "git add" and/or "git commit -a")

You can now remove the .patch file and commit the update.
rm 48.patch ; git commit -av

Captain's Log | Monday 11th of May 2015

Windows Server 2008 and Windows Server 2008 R2 | Draytek router | stops resolving DNS queries
After a period of time Windows DNS server stops resolving external DNS requests. You can ping/access the sites via the IP address but are unable to have them resolved unless you restarted the DNS Server Service on the Windows Server.

To resolve the issue and continue using root hints, change the MaxCacheTTL registry value to 2 days or greater.

Warning: Serious problems might occur if you modify the registry incorrectly by using Registry Editor or another method. These problems might require you to reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

1.    Start Registry Editor (regedit.exe).
2.    Locate the following registry key:
3.    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters
4.    On the Edit menu, click New, click DWORD (32-bit) Value, and then add the following value:
Value: MaxCacheTTL
Data Type: DWORD
Data value: 0x2A300 (172800 seconds in decimal, or 2 days)
5.    Click OK.
6.    Quit Registry Editor.
7.    Restart the DNS Server service.

from: https://support2.microsoft.com/default.aspx?scid=kb;EN-US;968372
wrong spellings: dreytec dreytek dreytech