GPG extend expiration date (offline master key)

Key expiration dates are a good rule of thumb but someone needs to follow up on them.

I personally configure my keys with short expiration dates and when required I extend them.

First since I have an offline master key I need to update my GNUPGHOME env variable

export GNUPGHOME=/media/kostas/63D8-90BC/gnupghome

After doing that I list my keys and then select the one I want to edit

gpg –list-keys

gpg –edit-key 5755AA4A
> expire
> 100
> y
> key 1
> expire
> 100
> y
> save

gpg –list-keys

gpg –keyserver keys.gnupg.net –send-key 5755AA4A

 

I will soon update with relevant screenshots so that it is more easy to follow up!

Posted in Uncategorized

Declaring an array on specific address

Say that you want to declare an array but you want it to exist and start on a specific address in the flash area. The way to do it is simple:

uint16_t exmpl_array[size] @ (FLASH_ADDRESS) = {0xFFFF, 0xFFFF, … }

Note that not all compilers support this feature.

Posted in Uncategorized

[sed] replace slash slash comments (//) with slash asterisk (/* */)

Easy way to get rid of slash slash style comments

sed ‘/\/\//{s/\/\//\/\* /g;s/$/ \*\//g}’ file.txt

For avoiding the confusing delimiters you can use this one instead.

sed ‘\_//_{s_//_/* _g;s_$_ */_g}’ file.txt

Tagged with: , ,
Posted in Uncategorized

Integrate gVim into your IAR workbench

Vim fan working with a board kit for some new embedded project? If IAR is your workbench then you might be interested in this!

Under Tool->Options choose the Editor Tab and further on External Editor. Check that “Use External Editor” checkbox and fill in the following:

Type: Command Line

Editor: Path you your gvim.exe most likely C:\Program Files (x86)\Vim\vim74\gvim.exe

Arguments: –remote-tab-silent $FILE_PATH$

Posted in Uncategorized

Switch to headset on connect

Want to switch pulse audio to the headset you just plugged in in your Ubuntu machine?

Then add this line in your /etc/pulse/default.pa conf file:

load-module module-switch-on-connect

Posted in Uncategorized

Code caller/callee profiling with callgrind

Profiling your code in terms of caller callee function calls can prove quite useful. Seeing which parts of your code are  greedy is another aspect of it.

Build your code as you usually do and then call valgrind’s callgrind tool

valgrind –tool=callgrind –trace-children=yes ./my_executable

This will result to a file callgrind.out.#### that can be opened with kcachegrind. Try it out!

Tagged with: , ,
Posted in Coding

Installing gcc-4.9 g++-4.9

Want the latest features from your favorite compiler?

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update

sudo apt-get install gcc-4.9 g++-4.9

sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc

sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++

Go out ant try it!!!

 

Tagged with: ,
Posted in Coding, Linux