Skip to content

Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"

Somehow, most of the time my Arduino-based EggBot clone outputs one byte of undetermined garbage before saying "Ready". This caused gcode-sender.rb to fail with "invalid byte sequence in UTF-8 (ArgumentError)".

Eventually I found the solution in a post by Wayne Brissette here: https://www.ruby-forum.com/topic/4409620. Basically you need to treat the string as binary instead of utf-8. This small change in the code that waits for the robot to be ready fixed the issue for me:
--- gcode-sender.rb.orig
+++ gcode-sender.rb
@@ -30,7 +30,7 @@
sp.read_timeout = 0 # Necessary for Windows.
while line = sp.gets
print line
- break if line.match(/^Ready/)
+ break if line.force_encoding("BINARY").match(/^.?Ready/)
end
File.foreach(filename) do |line|
line.chomp!

  • Twitter
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"
  • Mixx Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"
  • Bloglines Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"
  • Technorati Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"
  • Fark this: Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)"
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at YahooMyWeb
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at Furl.net
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at reddit.com
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at blinklist.com
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at Spurl.net
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at NewsVine
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at Simpy.com
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" at blogmarks
  • Bookmark Fixing gcode-sender.rb / serialport.rb "invalid byte sequence in UTF-8 (ArgumentError)" with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Accessing iPhone (iOS 10.2.1) pictures from Ubuntu

Recent changes introduced with iOS 10 prevent you from mounting an iPhone on a regular Ubuntu installation.

The PPA by Martin Salbaba used to fix the issue, but it hasn't been updated in a while, and now when I connect my iPhone (running iOS 10.2.1) the pictures are no longer accessible, although the documents are still there.

This solution worked for me (Ubuntu 16.04):

- install libimobiledevice6 + dependencies from this PPA: https://launchpad.net/~martin-salbaba/+archive/ubuntu/ppa+libimobiledevice (follow the instructions there)

- install newer libimobiledevice version according to the "recipe" by A.B. here: http://askubuntu.com/questions/598940/libimobiledevice-1-2-ios-8-support-for-ubuntu-14-04-trusty

- install ifuse according to the same method:
cd ~/src/
git clone https://github.com/libimobiledevice/ifuse.git
cd ifuse/
sudo apt-get install libfuse2 libfuse-dev
./autogen.sh
make
sudo checkinstall

You can now mount your iPhone like this:
mkdir ~/mnt
ifuse ~/mnt
I assume the same procedure would work for an iPad too.
  • Twitter
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Accessing iPhone (iOS 10.2.1) pictures from Ubuntu
  • Mixx Accessing iPhone (iOS 10.2.1) pictures from Ubuntu
  • Bloglines Accessing iPhone (iOS 10.2.1) pictures from Ubuntu
  • Technorati Accessing iPhone (iOS 10.2.1) pictures from Ubuntu
  • Fark this: Accessing iPhone (iOS 10.2.1) pictures from Ubuntu
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at YahooMyWeb
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at Furl.net
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at reddit.com
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at blinklist.com
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at Spurl.net
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at NewsVine
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at Simpy.com
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu at blogmarks
  • Bookmark Accessing iPhone (iOS 10.2.1) pictures from Ubuntu with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

The solution to all "favicon" questions (favicon generator, analyzer and more)

This website is a really useful resource: https://realfavicongenerator.net/

  • Twitter
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg The solution to all "favicon" questions (favicon generator, analyzer and more)
  • Mixx The solution to all "favicon" questions (favicon generator, analyzer and more)
  • Bloglines The solution to all "favicon" questions (favicon generator, analyzer and more)
  • Technorati The solution to all "favicon" questions (favicon generator, analyzer and more)
  • Fark this: The solution to all "favicon" questions (favicon generator, analyzer and more)
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at YahooMyWeb
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at Furl.net
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at reddit.com
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at blinklist.com
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at Spurl.net
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at NewsVine
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at Simpy.com
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) at blogmarks
  • Bookmark The solution to all "favicon" questions (favicon generator, analyzer and more) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

APA106 KiCad library (including APA-106-F8 footprint and 3D model)

Wondering what APA106 addressable RGB LED are? Get some from eBay, AliExpress or SparkFun.

In case this is useful to anyone else: here is my APA-106-F8 RGB LED KiCad library, including 3D model for pretty rendering.

The 3D model was made with OpenSCAD based on the instructions from Christopher J. Woodall. (The only difference is that I used meshlab to convert the OpenSCAD STL to binary instead of meshconv.)

You are free to use/change/distribute it in any way for any purpose. Attribution would be nice but is not mandatory.

If you are interested, here is the OpenSCAD source file.

  • Twitter
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg APA106 KiCad library (including APA-106-F8 footprint and 3D model)
  • Mixx APA106 KiCad library (including APA-106-F8 footprint and 3D model)
  • Bloglines APA106 KiCad library (including APA-106-F8 footprint and 3D model)
  • Technorati APA106 KiCad library (including APA-106-F8 footprint and 3D model)
  • Fark this: APA106 KiCad library (including APA-106-F8 footprint and 3D model)
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at YahooMyWeb
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at Furl.net
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at reddit.com
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at blinklist.com
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at Spurl.net
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at NewsVine
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at Simpy.com
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) at blogmarks
  • Bookmark APA106 KiCad library (including APA-106-F8 footprint and 3D model) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Linux - extract data from an "OLE Compound" file

As seen here, 7-Zip can extract the contents:
$ file PGPexch.ole
PGPexch.ole: Composite Document File V2 Document, No summary info
$ 7z x PGPexch.ole

7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Processing archive: PGPexch.ole

Extracting [1]CompObj
Extracting [1]Ole
Extracting CONTENTS
Extracting [3]ObjInfo
Extracting [2]OlePres000
Extracting [3]MailStream

Everything is Ok

Files: 6
Size: 104336
Compressed: 108544
$ file CONTENTS
CONTENTS: PDF document, version 1.5
$
(If the OLE data is hidden in a WINMAIL.DAT file, you may have to extract it with tnef first.)

  • Twitter
  • Bookmark Linux - extract data from an "OLE Compound" file at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Linux - extract data from an "OLE Compound" file
  • Mixx Linux - extract data from an "OLE Compound" file
  • Bloglines Linux - extract data from an "OLE Compound" file
  • Technorati Linux - extract data from an "OLE Compound" file
  • Fark this: Linux - extract data from an "OLE Compound" file
  • Bookmark Linux - extract data from an "OLE Compound" file at YahooMyWeb
  • Bookmark Linux - extract data from an "OLE Compound" file at Furl.net
  • Bookmark Linux - extract data from an "OLE Compound" file at reddit.com
  • Bookmark Linux - extract data from an "OLE Compound" file at blinklist.com
  • Bookmark Linux - extract data from an "OLE Compound" file at Spurl.net
  • Bookmark Linux - extract data from an "OLE Compound" file at NewsVine
  • Bookmark Linux - extract data from an "OLE Compound" file at Simpy.com
  • Bookmark Linux - extract data from an "OLE Compound" file at blogmarks
  • Bookmark Linux - extract data from an "OLE Compound" file with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca