Skip to content

Instantly share code, notes, and snippets.

View hakonhagland's full-sized avatar

Håkon Hægland hakonhagland

  • NORCE Research
  • Norway, Bergen
View GitHub Profile
@hakonhagland
hakonhagland / README.md
Created October 13, 2023 09:14
Debugging with Perl EPIC plugin in Eclipse

Eclipse with EPIC plugin on Linux (Ubuntu 22.04)

  • I created a Perl project "hello"

image

  • To set breakpoint, right-click on the numbers in left gutter and select "Toggle Breakpoint"

image

  • To debug, select "Run" menu, then "Debug" sub menu (or press F11):
@hakonhagland
hakonhagland / README.md
Created October 9, 2023 19:08
Debug perl in VS Code on Windows

Open Ubuntu 22.04 WSL terminal in Windows Console

  • Update and upgrade packages:
$ sudo apt-get update
$ sudo apt-get upgrade
  • Install build tools
➜ ~ cpan App::Lingua::BO::Wylie::Transliteration
Loading internal logger. Log::Log4perl recommended for better logging
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /System/Library/Perl/5.30/App/Cpan.pm line 679, <STDIN> line 1.
@hakonhagland
hakonhagland / log.txt
Created July 2, 2021 19:31
Building amazon-kinesis-video-streams-producer-sdk-cpp on Windows 10
This file has been truncated, but you can view the full file.
-- Kinesis Video Cpp Producer path is C:/test/akvspsc
-- dependencies install path is C:/test/akvspsc/open-source
-- Begin building dependencies.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/test/akvspsc/open-source/liblog4cplus
Scanning dependencies of target project_log4cplus
[ 11%] Creating directories for 'project_log4cplus'
[ 22%] Performing download step (git clone) for 'project_log4cplus'
Cloning into 'project_log4cplus'...
@hakonhagland
hakonhagland / grep-hash.pl
Last active April 7, 2021 16:50
Grep array of hash refs
my @items;
for my $ref (@whole) {
my $key = $ref->{name};
push @items, $key if !exists $props{$key};
}
@hakonhagland
hakonhagland / kvm-copy-paste.md
Last active April 18, 2024 16:11
How to make copy&paste work between Ubuntu host and Windows 10 guest for a KVM virtual machine?
@hakonhagland
hakonhagland / oauth-pm.patch
Created July 16, 2019 21:51
Fix syntax errors in OAuth.pm
diff --git a/OAuth.pm b/OAuth.pm
index 5985f5d..d15b367 100644
--- a/OAuth.pm
+++ b/OAuth.pm
@@ -193,7 +193,7 @@ the object back to the state it was in when constructed.
sub resetTokens {
my $this = shift;
- for my $key qw(request_token request_token_secret access_token access_token_secret)
+ for my $key (qw(request_token request_token_secret access_token access_token_secret))
@hakonhagland
hakonhagland / install_gnu_gsl.md
Last active October 10, 2018 19:12
Install Gnu GSL library on Ubuntu

Download the tar file:

sudo apt-get install make
cd $HOME
mkdir -p gsl
cd gsl
wget http://gnuftp.uib.no/gsl/gsl-latest.tar.gz
tar zxvf gsl-latest.tar.gz
rm gsl-latest.tar.gz

After having installed google chrome on Ubuntu 18.04, I had an issue when opening chrome for the first time after login. There was an annoying dialog window asking me to enter a password to unlock the login keyring. Probably there was a good security reason for this? Maybe it was because I had set Ubuntu not to ask for a password when I log in? Anyway, this gist explains how I got rid of this dialog.

  • First, click "Show Applications" icon on the desktop screen, from there select the "Password and keys" icon.
  • In the "passwords and keys" window, right click "Login" in the left column and choose "Unlock" if the keyring is locked.
  • Type in your login password to unlock the keyring
  • Then again, right click "Login" in the "Password and login" window and choose "Delete" to delete the login keyring.
  • Then close the "Passwords and keys" window

This was tested on a macOS High Sierra version 10.13.4

I already had XCode installed. First, we need a C compiler to install perlbrew. I had upgraded my mac so I needed to agree to the licence once more:

sudo xcodebuild -license

Now the C compiler should be working. Then I installed perlbrew:

curl -L https://install.perlbrew.pl | bash