Monday, December 23, 2024

Building Data::UUID on Haiku

 *** UUID.xs 2024-09-25 11:06:47.817889280 -0400

--- ../UUID.xs 2024-09-25 10:55:40.565182464 -0400

***************

*** 8,15 ****

  #  include <OS.h>

  #endif

  

! #ifdef __HAIKU__

! #define bool unsigned int

  #  include <OS.h>

  #endif

  

--- 8,14 ----

  #  include <OS.h>

  #endif

  

! #if defined __HAIKU__

  #  include <OS.h>

  #endif

Building Net::SSLeay on Haiku

 *** ../Net-SSLeay-1.94-5/Makefile.PL 2024-01-07 19:43:17.050593792 -0500

--- ./Makefile.PL 2024-09-26 10:44:10.662700032 -0400

***************

*** 120,125 ****

--- 120,130 ----

  # macros are available).

  add_ccflag( $eumm_args{CCFLAGS}, "-DNET_SSLEAY_PERL_VERSION=" . $] * 1e6 );

  

+ if(-d '/boot/system/develop/headers/x86/openssl') {

+ # Haiku

+ add_ccflag($eumm_args{'CCFLAGS'}, '-I/boot/system/develop/headers/x86/openssl');

+ }

  # Suppress deprecation warnings during compilation.

  # https://www.openssl.org/docs/manmaster/man7/openssl_user_macros.html

  add_ccflag( $eumm_args{CCFLAGS}, '-DOPENSSL_API_COMPAT=908' );

***************

*** 224,229 ****

--- 229,235 ----

      my @try_includes = (

          'include' => sub { 1 },

          'inc32'   => sub { $OSNAME eq 'MSWin32' },

+ '/boot/system/develop/headers/x86' => sub { $OSNAME eq 'haiku' },

      );

  

      while (

***************

*** 235,240 ****

--- 241,250 ----

                             || -f "$prefix/$dir/ssl.h")) {

              $opts->{inc_path} = "$prefix/$dir";

          }

+ if($cond->() && (-f "/$dir/openssl/ssl.h")) {

+ # e.g Haiku

+ $opts->{inc_path} = $dir;

+ }

      }

  

      # Directory order matters. With macOS Monterey a poisoned dylib is

Wednesday, April 12, 2023

Concatenate Two Images Horizonally

To combine two images into one image, use the convert command from ImageMagick:

convert input1.png input2.png +append output.png

Saturday, November 5, 2022

Reverting a Git Commit You Regret

Ignore all the recommendations on stackoverflow about "git reset", none works since you end up finding you can't commit a change without doing a git pull which means you lose the reversion you tried to do.

Use "git log" to find the last good commit's checksum then run:

git checkout $checksum .

git commit -m 'backing out broken code' -a

git push

Tuesday, June 5, 2018

Installing OS/X Packages in Home without Admin rights

Not all packages will work, but I managed to install ownCloud's client into my home directory without admin rights, and I'm sure this will work for other packages whose installer don't give you the ability to change the target directory.

cd ~/Downloads
>Download foo.pkg<
mkdir foo
cd foo
xaf -xf ../foo.pkg
cd ~/Applications
tar zxvf ~/Downloads/foo/foo.pkg/Payload
>open foo.app<

Thursday, January 18, 2018

Netgate Openbsd

amd64
install to sd0 from USB in USB3 socket.
See https://www.netgate.com/docs/platforms/rcc-ve-8860/openbsd.html

Thursday, November 3, 2016

Let's encrypt support for Debian

apt-get install python-certbot-apache
certbot --apache
chmod 640 /etc/letsencrypt/live/*/privkey.pem

in /etc/apache2/sites-enabled/$sitenamefqdn-ssl.conf:

Header always set Strict-Transport-Security "max-age=31536000"
ServerAdmin njh@bandsman.co.uk
ServerName www.$sitenamefqdn
ServerAlias $sitenamefqdn
CustomLog ${APACHE_LOG_DIR}/ssl_access.log "%t %h %{SSL_CLIENT_S_DN}x%{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b %{User-agent}i"
SSLCertificateFile /etc/letsencrypt/live/$sitenamefqdn/fullchain.pem 
SSLCertificateKeyFile /etc/letsencrypt/live/$sitenamefqdn/privkey.pem

 in /etc/mail/sendmail.mc:
 
define(`SSL_DIR',`/etc/ssl')dnl
define(`CERT_DIR',`/etc/letsencrypt/live/$sitenamefqdn')dnl
define(`confCACERT_PATH', SSL_DIR`/certs')dnl
define(`confCACERT',  CERT_DIR`/fullchain.pem')dnl
define(`confSERVER_CERT', CERT_DIR`/cert.pem')dnl
define(`confSERVER_KEY', CERT_DIR`/privkey.pem')dnl
define(`confCLIENT_CERT', CERT_DIR`/cert.pem')dnl
define(`confCLIENT_KEY', CERT_DIR`/privkey.pem')dnl
define(`confCRL',SSL_DIR`/crl/cacert.org.revoke.crl')dnl

in /etc/dovecot/conf.d/10-ssl.conf:

ssl_cert =
$sitenamefqdn/fullchain.pem
ssl_key =
$sitenamefqdn/privkey.pem
Add this to puppet

cron {
  'lets encrypt renewal':
    command => '/usr/bin/certbot renew',
    user => root,
    hour => 2,
    minute => 22,
    monthday => 3,
    month => 1,4,7,10;
}