Skip to content

Instantly share code, notes, and snippets.

@tpraxl
tpraxl / install-self-signed-cert-on-ubports.md
Created August 8, 2019 20:33
Installing a self-signed certificate on ubports for access to nextcloud

Installing a self-signed certificate on ubports

For my intranet-only nextcloud installation, I have generated a self-signed certificate:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nextcloud.key -out /etc/nginx/ssl/nextcloud.crt

I'm running ubports 16.04 stable on a nexus 5.

@tpraxl
tpraxl / server_certificates_to_pem.md
Created August 8, 2019 18:36 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@tpraxl
tpraxl / convert-videos-for-web.sh
Created April 30, 2019 08:02 — forked from ob7/convert-videos-for-web.sh
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
#!/bin/bash
#Scaling
#- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
#- Other options include setting both with & height
#- Watch out for sizing errors when not divisible by 2
if [[ ! "$1" || ! "$2" || ! "$3" ]] || [[ "$1" = '--help' ]]; then
if [[ "$1" = '--help' ]]; then
echo " "
@tpraxl
tpraxl / rasberry-pi-setup-over-ssh-without-hdmi.md
Last active April 4, 2019 20:45
rasberry pi setup over ssh without hdmi

Rasberry Pi setup over ssh without hdmi

SD CARD and SSH setup preparations

WiFi setup

For WIFI to work immediately, add boot/wpa_supplicant.conf with the following content:

@tpraxl
tpraxl / install_weasy.sh
Created August 24, 2018 14:43
Install weasyprint on uberspace
#!/usr/bin/env bash
# Last modified 2018-08-24
# This script assumes that you are on a fresh uberspace with not so much as the
# required dependencies installed
#
# Make sure to chmod u+x this script
pip3.6 install virtualenv --user
virtualenv ./env-weasy
@tpraxl
tpraxl / customized-agnoster.zsh-theme
Last active June 26, 2018 21:36
Custom agnoster task warrior theme
## ~/.oh-my-zsh/custom/themes/customized-agnoster.zsh-theme
##
## Inspired by Paul '@pjf' Fenwick ( https://www.youtube.com/watch?v=zl68asL9jZA )
## Keep the common agnoster.zsh-theme just as it
[…]
## Insert custom function right before Main prompt
## custom function to display the amount of overdue tasks, tasks due today, tasks due tomorrow and urgent tasks:
prompt_taskwarrior() {
@tpraxl
tpraxl / .qmail-test
Created June 7, 2018 11:32
Autorespond using IMAP on Uberspace 7 (U7)
|maildrop $HOME/.test-filter
@tpraxl
tpraxl / TestCase.php
Created January 27, 2018 06:21
ochestra/testbench how to load a .env file
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
abstract class TestCase extends \Orchestra\Testbench\TestCase
{
protected function getEnvironmentSetUp($app)
{
// make sure, our .env file is loaded
$app->useEnvironmentPath(__DIR__.'/..');
$app->bootstrapWith([LoadEnvironmentVariables::class]);
parent::getEnvironmentSetUp($app);
@tpraxl
tpraxl / ComponentWithResponsiveImage.js
Created December 28, 2017 18:22
React Native: Simple Responsive Image
// There are many complicated solutions out there.
// In fact, it's pretty easy to autoscale an image if you know the original dimensions.
// Otherwise, see Image.getSize. It should be easy to create a custom component that
// leverages Image.getSize to use this technique
//
import React, { Component } from 'react';
import { StyleSheet, Image, View } from 'react-native';
… // inside render()
<View style={styles.responsiveContainer}>
@tpraxl
tpraxl / 01-background.md
Last active July 9, 2017 14:13
Frontend developers guide to working with JEE applications

Background

I'm currently working on frontend stuff for a JEE application.

Some aspects of my usual frontend workflow seemed difficult to achieve in the first place, so I took some time to find out how to get back to my zero-turnaround workflow, even with a foreign setup that seemed to be difficult for that matter.

There seems to be a lack of documentation or written down experience, so I thought, I could at least publish my personal experience / setup. Comments and complement are very welcome.

I noticed that some frontend developers have problems setting up the java environment, so there's a section for this as well.