Archives 2005 - 2019

Getting a networked printer hanging off an Ubuntu server to print

published Sep 12, 2014 09:10   by admin ( last modified Sep 12, 2014 09:10 )

Notes to self:

In this case, a new PPD had to be used (on the client machine), since the old one magically and suddenly stopped working. Very non obvious and a reminder that Linux is still the land where you sometimes are faced with complexity that makes it similar to IT consultancy work just to print something.

The printer is a HP LaserJet M1522n MFP hooked up to an old laptop that functions as a printer server, with the printer shared on the network; I changed (on the client machine not the Linux server since that one printed fine) to a driver with a different suffix somewhere at the end of it all (the full name that is).


Styling CSS with attributes instead of classes

published Sep 05, 2014 09:50   by admin ( last modified Sep 05, 2014 09:49 )

Seems to make a lot of sense. It introduces a level of indirection where you can target styling changes to an attribute in a specific context. You can't do that with a CSS class. That is, you can't say that a class should be styled differently in a specific context, but you can say that an element having a certain attribute should be styled differently in a specific context.

It seems to clean up CSS quite a bit.


 

By creating a new Attribute Module am-Button, we can separate out the styles that are common to all buttons, to those that make a button large, to those that round a button's corners. Not only can we then freely combine these variations (e.g. am-Button='large rounded'), we can also target the attribute itself for any contextual overrides:


Read more: Link - Introducing AM - Attribute Modules for CSS - Glen Maddern: Internet Pro


"Send trough gmail" is gone for new e-mail aliases

published Sep 04, 2014 02:35   by admin ( last modified Sep 04, 2014 02:43 )

Having aliases handled through gmail is very convenient, but there is a change now, where you need to supply an SMTP server for each alias you register. This complicates things quite a bit. I now have to get hold of an SMTP server for a mail alias ASAP.

If you try to specify Gmail's own SMTP server, Gmail will check that server as a part of the form validation process, and Google will classify its own check as a hacking attempt targeting your account. At least that's what's happened when I tried, so it's probably better to use another SMTP server.

It seems like previously registered aliases still work and do not suffer from this. Be careful if you edit them though....

 

Now, Google has removed the option to send through their servers and we must specify the SMTP settings for our hosting provider’s server in order to send email as this address. Google has helpfully entered a best-guess of what the servername might be, but you’ll still have to check with your regular hosting provider to get the proper setup information.


Read more: Link - Gmail “Send As” Setup has Changed – BSD Systems


Interesting take on philosophy as a history of cognitive science

published Aug 29, 2014 12:29   by admin ( last modified Aug 29, 2014 12:29 )

This book, as far I remember since it was a long time since i read it, can be read as a history of philosophy, if you treat philosophy as theories on cognition. Which you often can.

 

The Mind's New Science: A History of the Cognitive Revolution


Read more: Link - Amazon.com: The Mind's New Science: A History of the Cognitive Revolution (9780465046355): Howard E. Gardner: Books


Picture in picture (pip) video with ffmpeg

published Aug 21, 2014 02:20   by admin ( last modified Aug 22, 2014 11:39 )

The following command line worked on Ubuntu 13.10. However it does not work with the avconv/ffmpeg shipped with Ubuntu. Instead a static build was used from this site:

http://ffmpeg.gusari.org/static/

 ~/bin/ffmpeg -i inlay.mkv -i background.mp4 -filter_complex "[0]scale=iw/5:ih/5 [pip]; [1][pip] overlay=main_w-overlay_w-10:main_h-overlay_h-10" PIP_video.mp4

This part:

[0]scale=iw/5:ih/5

...seems to control the size of the inlay, so a bigger divisor yields a smaller inlay. It may be that the [pip] follwing the part, tags file 0 as a pip thingy.

 

This part:

overlay=main_w-overlay_w-10:main_h-overlay_h-10

...seems to control where the inlay is placed, with coordinates being x,y with origo in the top left of the background (main) video. "main_w", "main_h", "overlay_w" and "overlay_h" seems to be variables available denoting the width and height of each video.

It may be that the "[1][pip]" preceding it first refers to the background video (being indexed as 1, that is the second video in a 0-based system), and the the "[pip]" somehow carries over from the preceding part and then references the video there. "pip" may have some pippy meaning or it is just a tag.

 

 

 
 
In a recent time I had a task to make a picture in picture effect of two videos using ffmpeg.In this blog I am going to share the details of how to make a PIP effect using ffmpeg and also configuring some of its factors.


Read more: Link - PICTURE IN PICTURE effect using FFMPEG


How could one automatically sync two audio recordings?

published Aug 19, 2014 02:05   by admin ( last modified Aug 21, 2014 02:17 )

Let's say I want to do a video presentation, where I want to record the audio that I want to use, onto a separate device, separated from the video camera.

I have now tested Allison Deal's Video sync (also linked under "Update II" in the question) and it seems to do the job.

In the root of its git directory there is a file called "alignment_by_row_channels.py". If you comment out the test code at the end of that file, it can take two mp4 videos and print the time offset between the audio in the two videos.

I tested it with a Canon HF200 video camera and an LG G2 android phone, with talk and finger snaps and very low volume on the video camera. I then manually analyzed the sound tracks with audacity.

The alignment_by_row_channels.py script indicated an offset between the two track of 15.1893 seconds. My manual analysis by looking at waveforms gave 15.181 seconds (audacity does not output less than millisecond resolution, at least not by default).

The difference is only 8.3 milliseconds or thereabouts which seems to indicate that "alignment_by_row_channels.py" does the job.

(Beware that the git repo is hefty, probably due to deleted big objects)

One way of doing that is to record the audio also with the camera, and then use your eyes and ears to sync the audio up using Audacity. How do that is described here:

How to Sync Video and Separately Recorded Audio, Using Only Open-Source Software

Update: I have found this python application with matching Android clapboard that could do the trick. It seems to work by syncing to a special sound recorded both in the video file and in the external audio file.

Update II: And here is another one in python, that is meant to be used to sync up Yotube videos recorded at the same concert.


A protected address book for Android - how to make one

published Aug 19, 2014 01:10   by admin ( last modified Aug 20, 2014 01:07 )

Many apps that get installed on an Android tablet or phone take a keen interest in the system address book. It is a place where Google can check your Facebook contacts and vice versa, and where Microsoft (in the shape of Skype) and many smaller companies also can take a stab at analyzing your social network.

There have been attempts at protecting the system address book from prying eyes, but as far as I know there are no simple up-to-date solutions.

So the obvious solution ought to be instead to create an app that is your address book, your real address book with its own database and hence with your contacts stored away from the system address book.

Someone ought to make such an app, and it cannot be that hard to do. Let's call it the Protected Address Book. It should be open source of course or we are back in the morass.

Initiating communication from the Protected Address Book

Many communication apps surely rely on the system address book for pulling contact information out, but it ought to be possible to initiate communication from the Protected Address Book, similar to a share button (or indeed use that one). In order to get around idiosyncracies of different apps, a plug-in system could be in place to get the right behavior from Gmail, Telegram, WhatsApp, Facebook, Skype and other apps.

Anyone up for getting the Protected Address Book rolling?


Wireless microphone options for video presentations

published Aug 18, 2014 10:55   by admin ( last modified Aug 18, 2014 11:02 )

I am currently researching wireless microphones for video presentations. I considered lavalier type microphones, which you clip on to your clothing, but decided to go for the earmic type, where the microphone is mounted on a wire around your ear.

To me the earmic seems to be in a position that is more predictable than clipping a lavalier mic onto whatever clothing you may be wearing at the moment. Ear mics may possibly pick up smacking and hissing from your mouth as you are talking to a larger degree than a lavalier type mice would, but I will take that risk. A lavalier type microphone also has the problem of picking up noise as it scratches towards your clothes.

These ones I've found interesting so far:

AKG WMS 40 Mini Earmic ISM3 - Thomann UK (~ €100)
the t.bone TWS Headset 863 MHz - Thomann UK (~ €100)
the t.bone TWS One C Headset - Thomann Sverige(~ €50)


t.bone is Thomann's own brand, apparently AKG compatible on the mic connector side. The AKG seems to have better sound quality

A video report on two of the units listed above, including the AKG (in German): Link - Mit Nackenbügelmikrofon aufnehmen - YouTube


Getting Skype to work again in Linux

published Aug 13, 2014 02:56   by admin ( last modified Aug 13, 2014 02:56 )

If you are on Skype 4.2, it has stopped working on Linux. You will not get an upgrade message, just a cryptic "Can't connect" message. The recommended solution is to upgrade to 4.3, which is supported by Microsoft. However that alone did not work for me, even when uninstalling the old version with "purge" (getting rid of old config files).

 

I also needed to delete the hidden Skype folder in my home directory:

 

First get rid of the old skype from repo: sudo apt-get purge skype Second, delete your ~/.Skype folder rm -R ~/.Skype


Read more: Link - Skype can't connect - Ask Ubuntu


Tip on masking tape when painting

published Aug 05, 2014 02:45   by admin ( last modified Aug 16, 2014 07:37 )

Basically when painting in two colours with masking tape, after you have done the masking over the "Base" colour, paint the base colour again on the non masked areas where you want the accent colour, let it dry an apply the accent colour. In this way the base colour will bleed under the tape, and seal and prevent bleeding from the accent colour.

 

The base is the color that's under the tape. Doing it this way lets that color bleed under the tape, but you won't see it because that's what color that part of the wall already is.


Read more: Link - icaruscoil comments on We painted our bedroom orange and grey, and threw up a neat wall pattern. No more boring brown walls.

 

masking, maskeringstejp, painting, måla, måleri


Discussion on avoiding spam in comments

published Jul 30, 2014 03:02   by admin ( last modified Jul 30, 2014 03:02 )



I run a custom-designed and developed system on my webforms. While the implementation is typically specific to a site, CMS, forms plugin, or what have you, the concepts behind it are general enough to be applied anywhere you have a form. It doesn't prevent 100% of spam, but by targeting the primary behaviors spambots use it prevents the majority of spam on web forms. There's two basic behavior-blocking elements at play in it:


Read more: Link - Strycken1 comments on Your users deserve better than Disqus


Skriv på bästa amerikanska

published Jul 23, 2014 12:04   by admin ( last modified Jul 23, 2014 12:04 )

Assisterar med att ta bort passivum, använda verb istället för adverb med mera, i engelska språket.

 

 


Read more: Link - Hemingway


A handbook on how to build trust and topple dictators

published Jul 12, 2014 06:05   by admin ( last modified Dec 17, 2014 06:45 )

Written by Gene Sharp. Can be downloaded here: http://www.aeinstein.org/wp-content/uploads/2013/09/FDTD.pdf


Deals with how to build trust between people and slowly strengthen the civil society until the dictator can be toppled (and something better come in his place).

 

From Dictatorship to Democracy, A Conceptual Framework for Liberation


Read more: Link - From Dictatorship to Democracy - Wikipedia, the free encyclopedia


Python's dateutils: "Generic parsing of dates in almost any string format"

published Jun 28, 2014 03:19   by admin ( last modified Jun 28, 2014 03:19 )

Worked like a charm for me:

 

Generic parsing of dates in almost any string format;


Read more: Link - python-dateutil - Labix


How to share a global variable across python modules

published Jun 19, 2014 12:30   by admin ( last modified Jun 28, 2014 03:22 )

How can you have a global object or variable that you can share across modules in python? Each module in python has its own name space and is happily unaware of anything defined in the others' name spaces. You can however import a variable from another name space, and then you can modify that and it will be visible in other modules that do the same. Except that you can't, because now it is in your name space and not the same as what the others have imported. What you can do however is to import the module in which it is defined, and then it gets changed everywhere.

 

Basically this won't work:

from flum import bletch

bletch = 67

That change will not be picked up by any other modules that do the same kind of import.

But this will work:

import flum

flum.bletch = 67

Because there is only one instance of each module, any changes made to the module object get reflected everywhere. For example:


Read more: Link - How do I share global variables across modules?


A quick way to switch keys and values in a python dictionary

published Jun 12, 2014 01:55   by admin ( last modified Jun 12, 2014 01:55 )
{value:key for key, value in a_dictionary.items()}

 

Tested in python 2.7


Having something be decrypted after a specific amount of time

published Jun 04, 2014 09:28   by admin ( last modified Jun 04, 2014 09:28 )

Even though we have got used to computers getting faster all the time, the truth of the matter is that certain things, such as clock speed, have barely improved at all for many years. If we can find calculations whose speed are basically proportional to the clock speed one can therefore know, roughly, how long time that calculation will take in wall clock time (human time) on a single processor. If that calculation is a decryption, then you have made a secret that will not be revealed before a certain amount of time. The calculation must not be possible to parallelize.

 

The decryption process uses long chains of hashes so it can't be parallelized - one fast CPU can decrypt the file faster than a million slightly slower CPUs. Moores law long ago ended for scalar performance - CPU clock speeds haven't budged in years - so predicting how long it'll take for the decryption to happen is possible


Read more: Link - Timelock: time-release encryption incentivised by Bitcoins (w/ 320mBTC bounty) : Bitcoin


This may be a book worth reading

published May 28, 2014 01:35   by admin ( last modified May 28, 2014 01:35 )



Liberalism: The Life of an Idea. By Edmund Fawcett.Princeton University Press; 468 pages; $35 and £24.95. Buy from Amazon.co.uk (ISBN=unknown)


Read more: Link - Liberal thought: On the barricades | The Economist


Virusexperiment inte värt risken

published May 21, 2014 02:04   by admin ( last modified May 21, 2014 02:04 )



But in a report on Tuesday, researchers at Harvard and Yale universities argue that the benefits of the work are outweighed by the risk of pathogenic strains escaping from laboratories and spreading around the world. They calculate that if 10 high-containment labs in the US performed such experiments for 10 years, the chance of at least one person becoming infected was nearly 20%. If an infected person left the laboratory, the virus might then spread more widely.


Read more: Link - Virus experiments risk unleashing global pandemic, study warns | World news | The Guardian

Blod kan göras ungt igen och föryngra hela personen

published May 04, 2014 03:20   by admin ( last modified May 05, 2014 03:20 )

Verkar det som, mycket intressant om de kommer nånvart med detta:

 

The Harvard teams went on to show they could replicate the anti-ageing effects of young blood with injections of a single blood protein called GDF11. The amount of GDF11 in the blood slumps when mice grow old. The injections restored the protein to more youthful levels.


Man kan f ö köpa GDF11 över Internet. Nån gamling kanske vill prova?

Read more: Link - Infusions of young blood may reverse some effects of ageing, studies suggest | Science | The Guardian