Archives 2005 - 2019    Search

Watermarking a video with ffmpeg

published May 17, 2018 05:26   by admin ( last modified May 17, 2018 05:26 )

Centered overlay/watermark:

ffmpeg -i original-video.m4v -i watermark.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2" watermarked-video.m4

See:

https://gist.github.com/bennylope/d5d6029fb63648582fed2367ae23cfd6


Linux Ubuntu 18.04 screen cast software that worked: vokoscreen

published May 15, 2018 12:15   by admin ( last modified May 15, 2018 12:15 )

Linux screen cast software that worked: vokoscreen (although sound had problems in the beginning & uncompressed capture did not work).
Didn't work: kazam (crashed computer, made orange into green).
Worked but no free area capture: gtk-recordmydesktop
All available via apt install on ubuntu 18.04LTS


Meetup.com's strange UI devolvement

published May 12, 2018 04:05   by admin ( last modified May 12, 2018 04:05 )

I do not know how big of an operation meetup.com is, but it seems clear to me that they do not employ a front-end developer normally, but probably just takes one in for a couple hours per year.

A new look has been launched some time ago that has removed all possibilities to format text for meetups, and just today I noticed that if you post a long comment, it will simply say that your post is too long and ask you to try again.

It used to say, even after the UI remake,  that your comment is too long together with info on what is the max amount of characters. That has now been removed. I'm baffled as to why they do not pay more attention their UI.

Also now, you cannot see all participants of a meetup, if it is more than eight. Well, as an admin you can by clicking an obscure link. It's like things just fall by the wayside.


How I got OpenVPN to work on Ubuntu 18.04LTS after sleep/suspend

published May 10, 2018 04:35   by admin ( last modified May 12, 2018 03:07 )

These are preliminary results, it seems to work.

Summary

Switch in the update-resolv-conf from here https://github.com/masterkorp/openvpn-update-resolv-conf/blob/master/update-resolv-conf.sh

and install openresolv

sudo apt install openresolv
  • reboot

The original update-resolv-conf distributed with the openvpn package in Ubuntu 18.04 did not work for me:

https://packages.ubuntu.com/xenial-updates/openvpn

Or, it could possibly be that openresolv resolved the problem of update-resolv-conf not exiting cleanly. I haven't bothered yet to check which of these two changes made the difference, but I suspect it is update-resolv-conf.

Longer text

I could not get systemd to reliably start OpenVPN, especially not after sleep. Restarting OpenVPN after sleep, through systemd, made OpenVPN work every second time. Every odd time (including time number 1) it complained about the up and down scripts not exiting cleanly:

"WARNING: Failed running command (--up/--down): external program did not exit normally"

I resorted to starting the vpn from the command line, same problem, so systemd is not at fault here.

The new update-resolv-conf script I use has this at the end:

# Workaround / jm@epiclabs.io 
# force exit with no errors. Due to an apparent conflict with the Network Manager
# $RESOLVCONF sometimes exits with error code 6 even though it has performed the
# action correctly and OpenVPN shuts down.
exit 0

Who knows, maybe that is all that was needed?

 


How to make curl be curt, but still output error messages such as timeout

published May 06, 2018 11:15   by admin ( last modified May 06, 2018 03:04 )

I needed to continuously check if a service was working, both checking for the response code from it and checking whether it replied at all. I used the shell "watch" command together with curl.

I silenced curl with "-s" in order to not see the progress bar, but still get the result. However that also silenced error messages. It turns out you need "-S" (capital S) to unsilence error messages.

watch curl -s -S http://foo.example.com

Incidentally, "http://example.com" returns a web page on my machine. Hence the "foo" subdomain.

-s Silent or quiet mode. Don't show progress meter or error messages. Makes Curl mute. -S When used with -s it makes curl show an error message if it fails.

Read more: Link - Making curl send errors to stderr and everything else to stdout - Stack Overflow


Systemd and openvpn on Ubuntu 18.04

published May 05, 2018 10:14   by admin ( last modified May 05, 2018 10:14 )

The below link is for 16.04 but seems to work for 18.04 too. My takeaways:

  • There is an /etc/default directory where you can edit the openvpn service to start the desired connection by default (tested)
  • There is an edit command for the systemd's systemctl (untested)

Read more: Link - Correct way of systemd for OpenVPN client on 16.04 Server? - Ask Ubuntu


Python 2.7 UnicodeDecodeError upgrading to Ubuntu 18.04 LTS

published May 03, 2018 07:39   by admin ( last modified May 03, 2018 07:39 )

Summary

Use

import sys
reload(sys) 
sys.setdefaultencoding('utf8')

Longer explanation (or at least more text)

A python script stopped working when upgrading from Ubuntu 17.10 to 18.04LTS. It was still running under python 2.7 but it now had the dreaded UnicodeDecodeError. Why?

Well, who knows, but a possibilty is that Ubuntu has stopped setting a default encoding. The solution is as above.

from __future__ import unicode_literals

…did not work since that made things such as

d.isoformat(' ')

 

stop working complaining about there being unicode.

 


Convert hex or base64 to binary on the Linux command line

published Apr 19, 2018 06:27   by admin ( last modified Apr 19, 2018 06:27 )

base64:

base64 -d infile.base64 > outfile.bin

hex (untested):

xxd -r -p input.txt output.bin

https://stackoverflow.com/questions/7826526/transform-a-hex-info-to-binary-using-linux-command


The IT guy

published Apr 08, 2018 04:03   by admin ( last modified Apr 08, 2018 04:03 )

I have met a few IT guys who sound pretty much like this. Often very knowledgeable in their field, but sometimes difficult to get to work fruitfully in a bigger context.


Legal/IT pioneers whose names I have problems remembering

published Mar 28, 2018 08:53   by admin ( last modified Mar 28, 2018 08:53 )

In the spirit of using this blog also as my notepad:

 

  • Eben Moglen
  • Lawrence Lessig

 

And some keywords so I can find them again:

EFF, Electronic frontier foundation, law, cyberspace. Columbia, Stanford.


How to use locate on an encrypted home directory

published Mar 14, 2018 10:45   by admin ( last modified Mar 14, 2018 10:45 )

Use a separate db for the encrypted part, and store that db on that encrypted part. A complete working solution with safeguards for not running when on battery or when the directory is encrypted, is linked below:

Read more: Link - tolaris.com · Secure locate with ecryptfs, part 2


Funny cat video: Sail

published Mar 12, 2018 11:44   by admin ( last modified Mar 12, 2018 11:44 )

Yopass - an attempt to more securely share secrets

published Mar 12, 2018 10:58   by admin ( last modified Mar 12, 2018 10:58 )

Seems to be about expiring urls and some encryption. Demo here: https://yopass.se/


Setting up 2 factor authentication for ssh logins on Ubuntu 16.04

published Mar 04, 2018 05:30   by admin ( last modified May 12, 2018 03:06 )

totp may be deployed so you can use your Google Authenticator, FreeOTP or similar, to add a layer of security to your ssh logins.

This guide worked for me (Linode):

Use One-Time Passwords for Two-Factor Authentication with SSH on Ubuntu 16.04 and Debian 8

While this guide did not enable totp for me:

https://www.digitalocean.com/community/tutorials/how-to-set-up-multi-factor-authentication-for-ssh-on-ubuntu-16-04

 


How to drop to console in Ubuntu 17.10

published Mar 02, 2018 09:55   by admin ( last modified Mar 04, 2018 05:27 )

It used to be Ctrl+Alt+F1, and then to get back Ctrl+Alt+F7.

Now it is Ctrl+Alt+F3, and the to get back Ctrl+Alt+F2. Actually a bit more logical than using F7. Ctrl+Alt+F1 is GUI login.

 

After upgrading to 17.10 like a true pioneer, I found the old CtrlAltF1 no longer switches between console mode and GUI, and a quick Google search brought up nothing useful. Was this feature removed entirely?


Read more: Link - gdm - How do I switch between console mode and GUI in 17.10? - Ask Ubuntu


Ord som har två motsatta betydelser

published Feb 26, 2018 10:51   by admin ( last modified Feb 26, 2018 10:51 )

I engelskan, som i svenskan, så har en del ord antagit två betydelser som är varandras motsatser. T ex i meningen: "Andrew's oversight caused a showstopper, and a dollop of money was made from the show".
Oversight betyder både överinseende och att missa att inspektera, showstopper betyder både att showen var så bra att alla stod och applåderade och att det inte gick att genomföra showen, och dollop betyder både en liten klutt och en stor klump. Så man har ingen aning hur det gick, ovan…

På svenska kan man bestrida en nota, vilket både betyder att betala den och att vägra betala den.


Summary by @Douglas9162 of Taleb's book "Skin in the game"

published Feb 23, 2018 12:26   by admin ( last modified Feb 23, 2018 12:26 )

This is a summary of Taleb's book "Skin in the game" tweeted in 100 tweets by @Douglas9162, tweeted here:

https://twitter.com/Douglas9162/status/965904588846051328

I saved the tweets, made some small edits wrt uniformity in spacing and capitalization.

(A bot has also directly summarised the tweets here: https://threadreaderapp.com/thread/965904588846051328.html )

SITG is about 4 things: uncertainty, symmetry in human affairs, information in transactions and rationality in complex systems. These 4 are best solved through SITG

1- If you want the upside, you must also take the risk of downside (bankers being bailed out by the public are the antithesis of SITG)

2- Opinions are BS generally, unless someone lives/is exposed to the risks of that opinion it is invalid

3- SITG isn’t purely incentives, it is symmetry in upside and downside. It is also about justice, honor and sacrifice.

4- Having exposure to the real world, with upside and downside, is the only way to learn properly (‘pathemata mathemata’ – guide your learning through pain)

5- EXPOSURE TO REAL WORLD CONSEQUENCES >>> Intellectualising (despite what academia tells us)

6-Think in dynamics, not statics. Think in high, not low dimensions. Think in terms of interactions as well as actions.

7- “what is crucial here is that the downside doesn’t affect the interventionist. He continues his practice from the comfort of his thermally regulated suburban house, with a two car garage, a dog, a small play area with pesticide free grass and his overprotected 2.2 kids” LOL

8- Intelligentsia have no downside for their actions (no SITG) so should be avoided like the plague.

9- Its much easier to MACRO bullshit than Micro bullshit. E.g. people who are cool on social media are depressing in real life. Marketing people should focus on macro therefore, as micro BSing is far harder.

10- Government intervention in general tends to remove SITG

11- You will never convince someone that he is wrong, only reality can. ALL people should be at risk of all downside to their decisions.

12- There is no evolution without skin in the game – note how academics can be wrong for so long while businesses cannot

13- SITG doesn’t literally mean an eye for an eye – it just means there is a downside large enough to individuals to protect the overall system.

14- We know far more what is bad than what is good. Therefore, when treating others: no bad actions > good actions as a rule.

15- Universal behavior is great on paper, disastrous on paper. Behaviour does not scale. Family are not friends and random people on the street are not friends. I may jokingly call my friend a “dickhead” as endearment, this doesn’t scale well

16- Avoid taking advice from someone who gives advice for a living, unless there is a penalty for their advice.

17- The doer wins by doing, not convincing. E.g. if someone is trying to convince you how cool their life is then it is not cool

18- How often you forecast correctly is unimportant, it is which outcomes you can forecast right which matters.

19- SITG helps solve the black swan problem as that which has survived over time with SITG has proved its robustness

20-There are some risks we just cannot afford to take (systemic risks). There are some risks we cannot afford to NOT take.

21- SITG is mainly a bullshit filter for professionally slanted people

22- Theories are fine, just don’t tell people how to apply them. People with SITG decide what theories they need.

23-people with SITG bring simplicity. People with SITG have no benefit for added complexity. Therefore be careful of people without SITG proposing complex solutions for a problem. They have incentive to seem sophisticated instead of just solving the actual problem

24- SITG adds interest to the normally boring. If you know that your repairs to a plane are needed for the safety of 200 people and a small child you have every incentive to get it right. While the repair may seem boring in isolation, with SITG its interesting(ish)

25- Risk focuses the brain, if you can muster the speed to run from a fire you can replicate this again. Anti fragility

26- Systemic risks are likely the most useful place for regulation

27- If you do not take risks for your opinion you are nothing

28- people that rationalize having dishonorable jobs (e.g. lobbyists) with the argument “I have kids to put kids through college” are pricks

29- The more you focus on optimization of your work, the more you will dislike it

30- Advice from Yossi Vardi – never have an assistant. It weakens your natural filtering. Assistance moves you one step away from authenticity

31- Companies with the owner’s name convey a strong message -  that they are willing to put their name on the line

32- People who write about ethics without having lived them are useless, look for people who have/had SITG then decided to write about it e.g. Montaigne

33- Whenever there is a mismatch with bonus period (1 year) and statistical blowup (10 years) people will transfer as much risk as possible to the future.

34- Taleb learned Akkadian to read Hammurabi’s law with Semitic phonetics just so he would be qualified to discuss it in his book. This is soul in the game

35- “I didn’t do mathematics to solve a problem, just to satisfy a fixation”, the perfect entrepreneur doesn’t care about anything except to satisfy a fixation. E.g. Musk just wants to go to fucking Mars, nothing will stop him. Fixations + SITG are antifragile

36- Learning is rooted in repetition and convexity, reading one book twice is more useful than two books once.

37- professional reviwers tend to want to impress other reviewers while normal people just say their opinions, so be careful of professional reviewers as they have a lack of SITG

38- Plenius aequo Laudat venalis qui vult extrudere merces – one lauds merrily the mechandide to get rid of it. Be careful of information asymmetries

39- On selling ethically: ‘you can give advice, or you can sell (by advertising the quality of the product), and the two need to be kept separate’

40- Laws come and go, ethics stay

41- Counterintuitively, the more regulations, the easier it was to make money. Careful of people who want more regualtions as they have incentive to complexify it so they are more needed.

42- No person in a transaction should have certainty about the outcome while the other one has uncertainity

43- it may not be ethically required, but the most effective, shame-free policy is maximal transparency, even transparency of intentions.

44- For when the “we” becomes too large a club, things degrade and each one starts fighting for his own interest.

45- I am, at the fed level, Libertarian;
at the state level, republican;
at the local level, Democrat;
at the family and friends level, a socialist.

46- The most reliable advocate for a product is its user.

47- Every metric is gameable, be very careful how metrics are used in performance.

48- The most intolerant group tends to always win. Why we eat Halal in UK despite Muslim population is only 4%ish. Society evolves by the intolerant minority.

49- The average behavior of the market participant will not allow us to understand the general behavior of the market

50- Freedom entails risks, real skin in the game. Freedom is never free

51- People who depend on their reputation within a coorporation are the most fragile

52- Manners don’t matter if you are profitable, can be seen in footballers – Suarez bit someone yet still scores so no one cares. This is antifragile.

53- It’s easy to spin a story that it is easier to continue than to stop (when making a bad choice)

54- Being ethical can come at a huge cost to others, people hope Snowden like people don’t have kids so then they are individual martyrs. However this is perverse.

55- By minority rule it takes very few detractors to scare an institution into firing you by using certain buzzwords regardless of whether they are true, e.g. XYZist

56- If you go into politics have no friends.

57- Scars signal skin in the game

58- Label driven, highly educted people who tell us: what to do, what to eat, how to speak, how to think, whom to vote for are IYIs and should be avoided.

59- IYIs don’t really exist that often in real life which is good
Ny konversation

60- There is something respectable in losing a billion dollars, provided it is your own money. Winning > Losing >>> not even trying

61- No downside for some means no upside for the rest.

62- Data =/= rigor

63- When people win they have short explanations, when they lose they have long ones

64- Lindy effect; the longer something sticks around, the longer it will stick around in the future. E.g. the bible will still be around in 2000 years, whats top of the NYT book list now wont be. Very useful heuristic for many things

65- Don’t ask whether it makes sense, ask does it work

66- You can define a free person precisely as someone whose fate is not centrally or directly dependent on peer assessment.

67- Change for the sake of change is frequently the enemy of progress (inverse of lindy effect)

68- The good is not as good as the absence of bad

69- People who are easy to understand are more likely to be BSers, complex people more likely to be truthful

70- True intellect should not appear intellectual

71- Never pay for complexity of presentation when all you need is results

72- The mere fact than an evauation causes you to be judged not by the end result, but by some intermediary metric that invites you to look sophisticated, brings some distortions.

73- It costs a lot of energy to pretend you are not bored

74- if wealth is giving you fewer options instead of more, you are doing it wrong

75- ‘Verbal Threats reveal nothing beyond weakness and unreliability’ Either act or don’t.

76- If we don’t understand something and it has systematic effect, just avoid it

77- You can criticize what a person said or what a person meant. One is honorable, the other is embarrassing

78- virtue is what you do when NOBODY is looking. Virtue is not something you advertise.

79 – Courage is the only virtue you cannot fake

80- People on the ground, those with skin in the game, are not too interested in geopolitics or grand abstractions, but rather in having bread on the table.

81- We are largely collaborative except when institutions get in the way.

82- Relations between countries =/= relations between governments. Half my friends are Russian despite the fact I’m supposed to hate them for ‘hacking the election’

83- In the jungle, there are very few predators compared to collaborative animals. Humans are the same.

84- People who derive all their knowledge from books, live in a fantasy world - why a lot of historical books are BS

85- Beware labels when it comes to matters associated with beliefs, and avoid comparing all rellgions as if they are the same (they aren’t)

86- SITG is necessary in worshippers. Belief without sacrifice (acts as proof of belief) makes little sense.

87- People who denounce religion as whacky and ritualistic also meditate every day and attend concerts in awe. When you think about it everyone has some sort of ritualistic gestures they do.

88- There is a section called “ocular deception” which is my new way to describe Instagram and facebook

89- Survival comes first, truth, understanding, and science later.
Ny konversation

90- Rationality does not superficially look like rationality.

91- You do not need science to survive but you must survive to do science

92- Judging people by their beliefs is not scientific

93- The rationality of an action can be judged only in terms of evolutionary considerations

94- Taleb believes religion exists to enforce tail risk management across generations, as its rules are easy to teach and enforce

95- It is incoherent to criticise someones superstitions if they are to bring some benefits

96- Situation is considered non ergodic when observed past probabilities do not apply to future processes.

97- My death is never the worse outcome unless it correlates to that of others. Survival of the system is most important.

98- Courage is when you sacrifice your own well being for the sake of the survival of a layer higher than yours in the system.

99- Volatile things are not necessarily risky, and the reverse is also true. Risk and ruin are different tings

100- One may be risk loving yet completely averse to ruin.
 


Adding a Kotlin bintray repository with Maven

published Feb 19, 2018 02:25   by admin ( last modified Feb 20, 2018 03:55 )

Summary: Keeping <type>pom</type> in the source stanza as listed at bintray, makes IntelliJ/Maven unable to resolve the dependency. Deleting it makes it work.

Selection 062
Click to view full-size image…

 

 

 


Can recompiling the kernels with LFENCE mitigate spectre and meltdown?

published Jan 14, 2018 12:15   by admin ( last modified Jan 14, 2018 12:15 )

Daniel J. Bernstein on Twitter:

Even with today's ludicrously bloated kernels, I'm skeptical about the idea that speculative execution _in the kernel_ seriously helps computer performance. Has anyone measured overall slowdown from recompiling kernel branches to use LFENCE with new (fully serializing) microcode?

https://twitter.com/hashbreaker/status/951550271624241152


L4Linux — Linux ontop of a microkernel

published Jan 08, 2018 12:55   by admin ( last modified Jan 08, 2018 12:56 )

Untested by me, but I wonder if it is less susceptible to the meltdown and spectre attacks, at least some aspects of them.

 

Welcome to L4Linux!


Read more: Link - L4Linux