Well I didn’t know that!

I was just wondering if I could ‘cat’ something to clipboard from the terminal on the Mac, and you can!

i.e.

Open a terminal and do:

$ cat ~/Desktop/ded.html | pbcopy

Now that file is in the clipboard.

To put it somewhere else, that is, to paste it, do:

$ pbpaste > ~/Documents/ded.html

Now you should have a copy of ded.html sitting in ~/Documents.

credit to: https://apple.stackexchange.com/questions/15318/using-terminal-to-copy-a-file-to-clipboard

 

geektool – network info

Hey,

More geek tool things, just a simple network script that just shows interface status, part of this code belongs to someone else but I cannot find were I grabbed it from, sorry!

 

 

osx – Geektool Spotify

Hey all,

I wanted to write up an experience I had with a really cool OSX application I stumbled upon looking for a Mac equivocal of the famous sysinternals windows app bginfo

Googling around I found a variety of applications claiming to be able to add info to the background similarly to bginfo, but after trying a few out I stumbled onto Geektool.  After working out how the application worked which is actually quite simple and the power of it is amazing, first I played around with ifconfig and grep, outputted some ip information, then I added the date and time and was very pleased;

I then wondered what other people had used this tool for, I found that some people had created scripts to import Spotify ‘Now listening’ functions to the tool, it looked great and like something I’d really like to have on the desktop.  I found one on GitHub – here; https://github.com/bryantung/BTSpotifyGeeklet/releases which is based on some original code found here; https://github.com/Lucconouche/SpotifyNowPlaying but the original hasn’t been updated for quite a long time.

Whilst the instructions were quite clear on how to get the album text loaded, play time etc, I could not get the album art to appear, I tried other peoples album art imports but they just didn’t work, I discovered in my testing the plugin did actually get the correct URL to download the image, it just wasn’t putting it into the directory where the jpg file was meant to be going.  Due to the power of Geektool, I figured well if the script knows the URL lets just dump that URL into a file, cat the file, insert the URL into a variable and then curl the file down, then simply create an image in Geektool and point it at the file outputted from the curl.  I did that by creating what Geektool calls a ‘Shell Geeklet’, I then clicked on the ‘…’ highlighted below and added my code.

This then enabled me to add an image Geeklet which refresh’s every 5 seconds and we have the beautiful output below;

I’m quite sure I’ve more than likely done something wrong with this but, it worked for me, hope this helps someone.

James.

 

 

Windows remote reboot

As a MacBook user a lot of the time you’re at the mercy of using RDP to connect through to Windows servers for day-to-day tasks, occasionally a server will die that you’re working on and you’ll need to reboot it remotely, from a Windows VM you can instruct the server to reboot using the following commands;

Firstly you need to connect through to the server and authenticate, otherwise the reboot won’t happen;

Once you see ‘The command completed successfully’ you’re ready to issue the reboot, that is done by the following;

Issuing the above command will restart your server and insert Hung Operating system into the eventlog.

Happy rebooting!

 

 

Cisco ASA FQDN ACL

Following on a request from one of our clients I was looking into configuring ACL filtering, on ASA 9.2(3).  There are quite a lot of the guides out there, but they are missing a few important bits to make it work correctly, through trial and error with a friend of mine we found the following the correct way to configure it.

In this example I wanted to allow all connectivity from the inside LAN to connect to all websites with the exception of google.com.

A word of caution obviously you need to think about the order in which your ACL’s are being applied in order to make the ACL work.

The above commands setup DNS running locally on the ASA to query google’s dns servers. We now need to create our ACL on the ASA to match the traffic we are interested in blocking

To ensure that the ACL is actually resolving the correct IP’s for the hosts, you can check it with;

I saw a variety of other posts around the web talking about issues with low TTL on some sites, if you have issues with your ACL, I suggest you take a look at this article;

Cisco Support Forums – Hostname DNS access-lists

 

Cisco TMSPE Annoyances

TMSPE Installation issues

I’ve recently been reconfiguring Cisco TMS (Telepresence Management Suite) on a client server that lost all their data, following installing Microsoft SQL Express and then installing TMS I ran into a big problem installing the Cisco TMSPE (Provisioning Engine) connecting through to the SQL server, even though the TMS install had worked fine. I was presented with the following error when doing the install;

‘A network-related or instance-specific error occurred while establishing a connection to the SQL Server;

Capture

This error really bugged me and I couldn’t work out the cause. I read a post online that you needed to state the tcp port used to connect to the server and I thought, hang on is the server actually listening on TCP 1433..

Capture1

Running ‘netstat -a’ showed it wasn’t, so I checked the SQL configuration to see if it would accept remote connections and that confirmed it would;

Capture3

Looking at the configuration of the SQL server, I noted that by default, the SQL Server Browser was stopped, so I changed the service to start automatically and then started it.

Capture4

Then looking at the TCP/IP settings for the ‘SQL Server Network configuration’, you can clearly see that TCP/IP is disabled;

Capture5

You then need to restart the SQL Service;
Capture6

Upon doing so, you’ll then see that the TMSPE installation will then complete.

Capture1

Hope this helps someone else!

James

 

 

It’s all finished

Well, I’ve finished reading the Harry Potter series. I really REALLY enjoyed. I had a few minor complains about book seven; I though more detail could have been added around the final two Horcrux’s and how quickly the were destroyed, but overall, amazing. I always feel really sad about finishing a series of books knowing I can never go back to them and enjoy like the first time. Anyways, I have some movies to watch, still not seen one of them yet!

 

Harry Potter

Harry Potter Series paperback

Well, I have actually shocked myself.  A few years ago I heard an unpleasant comment by JK Rowling, I cannot recall exactly what she said but when I heard it I swore I was having nothing to do with her or any of her books ever.  Since listening to a work mate telling me he was reading Harry Potter to his 7 year old and I have complete and utter double standards I decided to go ahead and read the first book to see what all the fuss is about.

The first book was good, not amazing, but good enough for me to want to read more.  Having read most of the ‘The Chamber of Secrets‘ I’m hooked, cannot put it down enjoying immanency.  As you read the book you are there in Hogwarts, you can see all the charactures as if you are in the room.  It’s so well written, i’m just please I allowed myself to have double standards!