How do I remove old kernel versions to clean up the boot menu

When running a Ubuntu instance with limited disc space, the /boot can get filled with old (obsolete) kernels. If you run out of disk space on /boot, this is hou to clean up space.

First make sure there is still about 20 percent of disk space left on /boot by removing old kernel files (pick the large ones, but don’t delete the files with the highest kernel version !!)

If needed, fix any pending updates :
sudo apt-get install -f

Now run this command to “cleanup” old kernel versions :
dpkg –list|grep linux-image|awk ‘{print $2}’|sort -V|sed -n ‘/’`uname -r`’/q;p’|xargs sudo apt-get -y purge

Only uname -r is between quotes on ~ key, rest are regular single quotes

greetz, M.

Force Windows 7, 8, or 10 to Boot Into Safe Mode Without Using the F8 Key

So you are reading instructions on some article that tells you to reboot into Safe mode. You ask how you do that, and are told to use the F8 key when the computer boots up. But you just can’t seem to get the F8 key to work… so how do you boot into Safe mode?

There’s an option in the well-known System Configuration utility that will let you force Windows to always boot into Safe mode… until you turn the option off.
Force Windows to Boot into Safe Mode

Open up the start menu search or run box, and type in msconfig and hit the enter key. This should work in any version of Windows, including Windows 8 or 10. You can also use WIN + R to open the Run box and type it in there.

Select the Boot tab, and then check the box for “Safe boot” and make sure the radio button below is set to “Minimal”.

Once you hit the OK button you’ll be asked if you want to Restart now or wait until later. Either way, the next boot will take you into safe mode.

Once you restart, you’ll realize that you are in Safe Mode because it not only places that text in the four corners of the screen, but it even opens up the safe mode page from the help file in Windows 7 or Vista.

Once you are done fixing whatever you were working on, you’ll probably want to turn safe mode off and go back to normal mode. Just open up msconfig the same way as above, and then on the Boot tab you’ll uncheck the “Safe boot” checkbox.

So don’t forget to turn Safe Mode Back Off !!!!

This method especially helps if you need to repeatedly boot into Safe mode.

Greetz, M.

USB Rubber Ducky

The Duck is a USB thumb-drive lookalike with a secret — the hardware is really a micro-controller with a microSD Card interface.  The device can act as any kind of USB slave, with a program or script fed to it via the SD card.  The default personality for the Rubber Duck is a a USB keyboard.  Plug it in, and it will type keystrokes generated via a script file.

The Duck is one of those hacking tools with both good and evil uses.  On the ‘good’ side, it can be used for automatic entry of complex commands in an environment where centralized computer management is difficult.

On the evil side, it can be used to immediately pop up a command shell and type malicious commands, execute scripts (e.g. powershell scripts) and install and execute software (bypassing UELA on Windows). There are lots of scripts available on the net, so using them is quite simple. It’s even possible to add a few lines to your script to “see” if the new “keyboard” is detected by the OS and keyboard input (actually next script lines) are accepted by the OS.

Keystrokes themselves can be pretty dangerous, beyond just using built-in commands.  I’m finding the Duck particularly interesting because it bypasses many kinds of protection: USB Mass Storage can be disabled, Autorun can be disabled, and the Duck will still work.  Who locks their machine down enough to prevent a new keyboard from being plugged in?  I’m also becoming curious about Host OS fingerprinting: could a USB Slave device such as the Rubber Duck determine what kind of host it’s plugged into, based on the USB setup and queries it receives?  If so, the Duck could be programmed to be a universal system hacker, with separate payloads for Windows, Linux, Solaris, etc, running the script based on the system it was plugged into.

Last but not least there are dozens of pages describing how to build your own “Rubber Ducky” USB device if you have a USB stick with the right NAND chipset.

Keep this in mind the next time you find an USB stick outside and think about attaching it to your PC to see what’s on it …

Regards, M.

Smart TV or media streamer?

All smart TVs have streaming apps, like Netflix, Amazon Instant Video, Youtube, and so on. Media streamers are nothing but streaming apps. Sure it’s convenient to use your TV’s built-in services, but are they the best experience?

Probably not, actually. More to the point, is it worth getting a media streamer if you already have a smart TV? Maybe…

Behold, the pros and cons of TV apps and media streamers.

First, some terminology.

What is a smart TV ?

A smart TV, sometimes referred to as connected TV or hybrid TV, is a television set or set-top box with integrated Internet and Web 2.0 features, and is an example of technological convergence between computers and television sets and set-top boxes. Besides the traditional functions of television sets and set-top boxes provided through traditional broadcasting media, these devices can also provide Internet TV, online interactive media, over-the-top content, as well as on-demand streaming media, and home networking access.

Smart TV should not to be confused with Internet TV, IPTV or with Web TV. Internet TV refers to the receiving television content over internet instead of traditional systems (terrestrial, cable and satellite) (although internet itself is received by these methods). Internet Protocol television (IPTV) is one of the emerging Internet television technology standards for use by television broadcasters. Web television is a term used for programs created by a wide variety of companies and individuals for broadcast on Internet TV.

In smart TVs, the operating system is preloaded or is available through set-top box. The software applications or apps can be preloaded into the device, or updated or installed on demand via an app store or app marketplace, in a similar manner to how the apps are integrated in modern smartphones.

The technology that enables smart TVs is also incorporated in external devices such as set-top boxes, Blu-ray players, game consoles, digital media players, hotel television systems, and other network connected interactive devices that utilize television type display outputs. These devices allow viewers to search, find and play videos, movies, photos and other content from the Web, on a cable TV channel, on a satellite TV channel, or on a local storage drive.

(Source : http://en.wikipedia.org/wiki/Smart_TV)

What is a media streamer ?

Digital media players (DMP) are home entertainment consumer electronics devices that can connect to a home network to stream digital media (such as music, pictures, or video). They can stream files from a personal computer and network-attached storage or other networked media server to play back the media on a television or video projector for home cinema. Most digital media players utilize a 10-foot user interface, and many are navigated via a remote control.

Some digital media players also have Smart TV features, like allowing you to stream media from the internet or popular streaming services and online media sites like YouTube, Vimeo, Netflix, Hulu, Spotify, and Amazon.com. Some other digital media players also allow you to playback locally stored content from a direct attached USB hard disk or even direct connect a Hard disk drive externally, or even internally in the digital media player via a Serial ATA (SATA) port, therefore these types of digital media player are sometimes referred to as HD Media Player or HDD Media Player if they can support to have a Hard Disk Drive installed inside.

Digital media players are also commonly referred to as a digital media extender, digital media streamer, digital media hub, digital media adapter, or digital media receiver (which should not be confused with AV Receiver that are also called Digital Media Renderer). Today the main difference between most modern “digital media players” and many modern set-top boxes (also known a set-top units) is that the set-top boxes generally contain at least one TV-tuner and are as such capable of receiving broadcasting signal (cable television, satellite television, and over-the-air television, or IPTV).

(Source : http://en.wikipedia.org/wiki/Digital_media_player)

Here’s a breakdown of the strengths and weaknesses of each.

Available content

Winner: Media streamer
Loser: Smart TV

If all you want is Netflix, everything streams Netflix. I think I’ve seen a toaster that did it. But beyond that, it’s a lot less certain. A vital component to any streaming device (TV or dedicated), is the ability to buy and rent current TV shows and movies. The two services with the most content in that regard are Amazon and Apple. No TV has iTunes (and please don’t mention the Apple Television vaporware), and not all of them have Amazon Instant Video. Google Play is a reasonable runner-up, but it still doesn’t have the breadth of content of Apple and Amazon. Vudu is cool, but primarily movies, and US-only. Sony’s Video Unlimited service is decent too, but not widely available either. The better media streamers, like Roku and Apple TV, have Amazon Instant Video (or iTunes), along with a lot of other content like HBO Go in the US or Sky’s Now TV in the UK. HBO Go is available on numerous streaming boxes, but the only smart TVs that have it are from Samsung. The Apple TV also has the added ability to easily stream music from your computer, which I use all the time. Other TVs and streamers can do this, but it’s not as smooth an experience. To me, just that fact is enough to justify the cost of a media streamer. If the point is to watch content, media streamers offer more content providers than any single television.

Ease of use

Tie, sort of

It’s hard to compare all TVs against all media streamers. The better streamers, like the Roku 3 and Apple TV, but also a whole lot of android based media streamers, are fast and easy to use. Everything is laid out well, and you can get to what you want quickly and simply. Even the Fire TV, despite its other issues, is easy to navigate and fast to use. Some TVs have decent menus for their streaming content… but most don’t. Worse, they’re often slow and clunky to use. So on that level, the better media streamers win. There is the added simplicity, however, of only having one remote with a smart TV. Most people don’t like an Ottoman of Remotes, and using just the TV’s apps could save you from having to buy a universal remote. Comparing the best media streamers against the worst smart TVs, it’s an easy win for the streamers. The lesser streamers against the better TVs, it’s more of a wash. Since the better streamers are barely any more expensive than the worst, generally I’d say this category is a win for streamers. But overall, I guess I have to concede a tie.

Updates

Winner: Media streamer
Loser: Smart TV

This one goes to streamers in a landslide. Over the years Roku and Apple TV have undergone numerous software updates to improve available apps and tweak the interface. Chromecast is another streaming platform that has evolved significantly since launch, improving mirroring, adding app compatibility and promising even more improvements as developers dig in. Amazon Fire TV promises more updates of its own, including adding more catalogs to its voice search, but remains stubbornly US-only for now. Then there’s the TVs. If you bought a smart TV a couple years ago chances are its interface, apps and capabilities, not to mention its response time, seem dated by comparison to a $99 box. Most smart TV platforms are updated only during the year they were launched, if then, and afterward age as quickly as any technology. One exception is Samsung’s Evolution Kit, but it costs twice as much as a Roku 3.

Picture quality

Varies

Generally, picture quality shouldn’t be an issue. If your TV’s internal scaler isn’t great, however, it’s possible the scaler inside a media streamer is better. This could mean Netflix et al will be sharper than when streamed internally from your TV. This is because, for the foreseeable future, most streaming content will be 720p. There are some 1080p and even 4K exceptions, but they’re still fairly rare. What has to happen is the TV or streaming box must upconvert the 720p to your TV’s 1080p (or 4K). How well this is done determines how detailed the image can look. If you do have a 4K TV, you will have to use your TV’s built-in Netflix app (above) to see 4K content from them. Remember, just because your TV’s Info button says “1080p” doesn’t mean that’s what the signal is from Netflix, that’s just what your TV is receiving from the media box. Check out What is upconverting? and Ultra HD 4K TV Cheat Sheet for more info.

Cost

Tie, sort of (again)

Generally speaking, a smart TV costs about $100, or around £80, more than a “dumb” TV. The better media streamers cost about the same. So technically it’s a wash. It’s not that simple, however. If you want to get a good, top-of-the-line TV, it’s going to have smart features built in, whether you want them or not. So if you want to add a media streamer, you’re going to be paying for the same apps (mostly, as mentioned above) twice.

Bottom line

That last part is the kicker. Most people are going to be faced with adding a media streamer to a TV that already has most of the streaming services. Looking at it that way, this becomes more complex than a simple tally of ties, wins, and losses.

The question really is whether a media streamer is worth $100, when you already have a smart TV? Personally, I’d say yes, and I hate recommending people spend more money than they need to. It comes down to Amazon and iTunes. Being able to watch just about any show or movie whenever you want is huge, and most smart TVs just don’t offer that ability. Many also have clunky, annoying interfaces, and they’re not updated frequently. Sure there are some exceptions, but having a good media streamer means you can ignore a smart TV’s apps, both when you’re shopping, and when you’ve got it home. That’s worth $100 to me, easily.

Greetz, M.

helpful tcpdump command options

When creating a tcpdump, you don’t want to exclude to much information, to prevent a trace becoming useless. However large output files can be a pain to load and examine in Wireshark. There are some solutions though.

Create multiple files

tcpdump -n -C 128 -W 100 -i eth0 -w /tmp/packetlog.pcap &

  • -n don’t do reverse lookup on IPs, don’t convert port numbers to text descriptions, don’t convert MAC addesses to names, etc..
  • -C 128 rotate capture files every 128,000,000 bytes (128MB)
  • -W 100 limit the number of capture files being rotated (see -C) to 100
  • -i eth0 capture on interface eth0
  • -w /tmp/packetlogs/packetlog.pcap use file name /tmp/packetlogs/packetlog.pcap
  • & this is parsed by bash; indicates that the command should be run in the background (asynchronously)

Split the output file into smaller chunks

how to split a pcap file into a set of smaller ones :

tcpdump -r old_file -w new_files -C 10

The “-C” option specifies the size of the file to split into. Eg: In the above case new files size will be 10 million bytes each.

Enjoy ! M.

Failed to deploy OVF package: The task was canceled by a user (Solution)

Tried to deploy a OVF package. After finishing the wizard, vSphere stopped the deployment with the message “Failed to deploy OVF package: The task was canceled by a user.“. However there was no other user logged in !

The fix for this is very easy :

  • Deleted *.mf file and change settings in the ovf file

If your not deploying an OVF package but an OVA package, extract the files from the OVA package (e.g. using 7zip). There are files with different extensions :

  • ovf – OVF descriptor, written in XML, which describes the hardware requirements
  • mf – contains SHA1 checksums of the .OVA and .VMDK
  • vmdk – the virtual hard disk for the virtual machine.

I immediately discarded the .mf. If you modify the .ova and don’t update the .mf, it’ll complain that the checksum is invalid. Removing this file seems to prevent vSphere from checking the checksums, which is useful, seeing as we want to poke around the .ova. After fiddling around inside the .ovf, I stumbled across the following line…

<rasd:ResourceSubType>vmware.cdrom.iso</rasd:ResourceSubType>

Changing the above line, to read…

<rasd:ResourceSubType>vmware.cdrom.atapi</rasd:ResourceSubType>

…appears to have fixed my deployment issues. Perhaps changing the ‘CD Drive Device type’ in the virtual machine’s settings would’ve fixed it. But by that point, I had already exported the OVA and deleted the source virtual machine.

Hopefully someone will stumble across this one day, and it’ll save them a few hours !

Greetz, M.

Installing the XBMC SuperRepo

Most of the best XBMC addons are available on SuperRepo (http://superrepo.org/), which is highly recommended if you have a XBMC box. The following steps will take you through how to install the XBMC SuperRepo on your media center using only a keyboard.

  • Once you have started XBMC navigate to the “system” menu and open the file manager.
  • Select “Add Source” on the left panel of the screen.
  • Click on the textbox with says “None” to open up the keyboard entry.
  • Type the url http://srp.nu and click done.
  • Enter a name for the media source in the textbox below.
  • The repo will now be added to your file manager.
  • Go to “System” and then “Addons”.
  • Click “Install from Zip”.
  • Locate the relevant repository for your XBMC version.
  • This should now be added to your “Get Add Ons” screen

Greetz, M.

What are the different signal indicators avalable on the notification bar?

The signal indicator on my phone often shows “3G” or “H+” in the signal indicator. When there’s no connectivity it doesn’t show anything.
They are referring to the mobile data connection:

  • G : GPRS (slowest, data rates of 56–114 kbit/s)
  • E : Edge (enhanced GSM, data rates up to 236 kbit/s )
  • 3G : UMTS (data rates up to 384 kbit/s)
  • H : HSPA (enhanced 3G, data rates up to 14.4 Mbit/s)
  • H+ : HSPA+ (even more enhanced/faster HSPA, data rates up to 42 Mbit/s)
  • 4G : LTE (Long term evolution, data rates up to 300Mbit/s)

Note : all data rates mentioned are downlink peak rates. Uplink data rates are much lower.

Greetz, M.

ODBC connector for Excel error on 64 bit server

On a Windows 2008R2 server an error message appears when trying to add an ODBC connector for Excel (step 6 below).
The setup routines for the Microsoft Excel ODBC driver could not be found. Please re-install the driver.
1. In Windows, navigate to the Control Panel.
2. Double-click Administrative Tools.
3. Double-click Data Sources (ODBC).
The ODBC Data Source Administrator window opens.
4. Click the System DSN tab.
5. Click Add.
The Create New Data Source window opens.
6. Select Microsoft Excel Driver.
7. Click Finish.
The ODBC Microsoft Excel Setup window opens.
8. Specify a data source name.

Solution :
32-Bit Excel needs 32-Bit ODBC-Adminstrator odbcad32.exe which lives in C:\Windows\SysWOW64
64-Bit Excel needs 64-Bit ODBC-Adminstrator odbcad32.exe which lives in C:\Windows\System32

When creating your ODBC connection on a 64 bit server, use the built in 32 bit tool.

Greetz, M.

Using Shortcodes to Customize Your Posts

When using JetPack to publish blog posts by email, there are some shortcodes you can use in the mail message to customize your post.

I had a wide satisfactory smile (more like a grin) on my face after testing shortcodes. After a short while and without breaking a sweat, I learned you could add categories, tags, excerpts, slugs, polls, delay your posts for hours or days, and turn comments on and off among other things. Here is a list of the available shortcodes:

  • [title Your Desired Post Title] – Sets your post title in case you cannot access the subject field from your mobile device
  • [category a,b,c] – Adds categories a, b and c to your post. E.g. [category Recipes, How-To] will assign categories Recipes and How-To to your post
  • [delay +1 hour] – This shortcode will instruct WordPress to publish your post after one (1) hour. [delay +2 days] means your post will be published after two days
  • [end] – Everything after this bad boy is ignored. Put it at the very end of your post with a blank line above it. This is the only shortcode you can’t use anywhere else in the body of your email. You can place any other shortcode wherever in your email except the subject field of course ;)
  • [tags a,b,c] – Adds tags a, b and c to your post
  • [excerpt]Your excerpt goes here…[/excerpt] – This shortcode adds an excerpt to your post
  • [slug add-your-slug-here] – Adds a slug to your post. A slug is a browser and SEO friendly URL of your post
  • [comments on | off] – Turns comments on or off
  • [nogallery] – Deactivates the gallery and displays all images inline
  • –  Turns your gallery into a slideshow
  • [more] – Works just like the more tag
  • [poll] Quiz and answers[/poll] – Adds a Polldaddy poll
  • [nextpage] – Allows you to paginate your blog post
  • [publicize off | yahoo | twitter | facebook] – Allows you to set your publicize options. For instance, [publicize off] disables the publicize feature for that particular post, and [publicize twitter] sends notification to your Twitter account only
  • [status publish | pending | draft | private] – What do you think this does?

Note: You must write all shortcodes in lowercase.

Greetz, M.