Skip to content

Instantly share code, notes, and snippets.

View aweijnitz's full-sized avatar

Anders Weijnitz aweijnitz

View GitHub Profile
@aweijnitz
aweijnitz / install-cs.cart.sh
Created June 7, 2017 21:36
Install CS.Cart on Ubuntu 14.04
#!/bin/bash
# Based on http://docs.cs-cart.com/4.3.x/install/digitalocean.html
curl -sL http://cartoma.tk/installer | bash -s -- cart.is-by.us
cd /var/www/html/cart.is-by.us
wget "https://www.cs-cart.com/index.php?dispatch=pages.get_trial&page_id=297&edition=ultimate" -O cscart.zip && unzip cscart.zip
chown -R service ./
chmod 644 config.local.php
chmod -R 755 design images var
find design -type f -print0 | xargs -0 chmod 644
find images -type f -print0 | xargs -0 chmod 644
@aweijnitz
aweijnitz / .bash_profile
Created November 10, 2017 22:03 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@aweijnitz
aweijnitz / Twitter UTC Date Parser
Created February 20, 2014 21:22
Parsing UTC time from Twitter's created_at field
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.Locale;
/** Parse UTC time from Twitter's created_at field.
*
* Compile and run: javac TwitterDateParser.java && java TwitterDateParser
@aweijnitz
aweijnitz / installJava8.sh
Last active April 19, 2019 12:42
Provisioning script for non-interactive Java8 installation on Linux
#!/bin/sh
# From http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
#
# You need to run this script as root
#
# su -
echo "INSTALLING JAVA 8 AS USER `whoami` "
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
@aweijnitz
aweijnitz / partitionSpaceMonitor.sh
Created November 3, 2019 10:12
Shell script to run as a cron job and "run command" to prevent motionEyeOS from filling up the /data partition
#!/bin/bash
CURRENT=$(df /data/output | grep /dev | awk '{ print $5}' | sed 's/%//g')
THRESHOLD_CLEAN=60
THRESHOLD_FULL=85
if [ "$CURRENT" -gt "$THRESHOLD_CLEAN" ] ; then
find /data/output -type f -mtime +3 -exec rm -f {} \;
fi
if [ "$CURRENT" -gt "$THRESHOLD_FULL" ] ; then
@aweijnitz
aweijnitz / kubernetes-basics
Last active February 19, 2020 21:02
kubernetes basics with minikube
# Installation (Mac)
brew update; brew install minikube
minikube version
minikube start
# kubectl
kubectl version
@aweijnitz
aweijnitz / runDocker.sh
Created February 24, 2020 14:45
Start docker with latest node for local development
docker run -it --rm -p 5000:5000 -v $(pwd):/api -w="/api" node bash
@aweijnitz
aweijnitz / readingLists.md
Last active March 9, 2020 08:40
Reading List

Reading List

This is my attempt at collecting links and notes to myself to check. My current system is mailing links to myself, which is not really working well.

Virtualization, Deployment, DevOps

Firecracker - Secure and fast microVMs for serverless computing

Firecracker enables you to deploy workloads in lightweight virtual machines, called microVMs, which provide enhanced security and workload isolation over traditional VMs, while enabling the speed and resource efficiency of containers. Firecracker was developed at Amazon Web Services to improve the customer experience of services like AWS Lambda and AWS Fargate.

@aweijnitz
aweijnitz / installOpenWhisk.sh
Last active June 28, 2021 18:27
Install OpenWhisk on Minikube using Helm
# Assuming the following is installed and available
# - minikube installed and started
# - helm installed
# - OpenWhisk CLI, wsk, installed (not configured)
# - git clone https://github.com/apache/openwhisk-deploy-kube.git
#
# Clean up: In case you have a previously failed install, remove it from the cluster with the following line
# kubectl delete namespace openwhisk
# Create a namespace to deploy into
@aweijnitz
aweijnitz / audioCaptureOnRPi
Last active June 27, 2023 20:25
Useful one-libers for working with USB audio on Rasberry Pi
# Setup an RTMP streaming server running in Docker
docker run -d -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp
# Alsa tools needed for convenient sound interfacing
sudo apt-get -y install alsa-tools
sudo apt-get -y install alsa-utils
sudo apt install ffmpeg
# Start an RTMP stream to a remote streaming server