This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void paint(Graphics g) { | |
Graphics2D g2 = (Graphics2D)g.create(); | |
Area plotArea = new Area(new Ellipse2D.Double(center.x-radius, center.y-radius, diameter,diameter)); | |
g2.setClip(plotArea); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Poly with skin | |
clear; clc; | |
l=1e-6; c0=1e-9; | |
r0=100; f0=1000; alpha=0.8; | |
w=[2000 3000]; | |
w=(2*pi).*w; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* File: usbcdc.h | |
*/ | |
typedef struct | |
{ | |
const char* name; | |
float* loc; | |
} usbcdcParameterStruct_t; | |
void usbcdcSetShellVars(const usbcdcParameterStruct_t** vars); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo adduser deluge --shell /dev/null --disabled-password --disabled-login | |
sudo apt install deluged deluge-webui | |
sudo gpasswd -a $USER deluge | |
cat <<EOF | sudo /etc/systemd/system/deluged.service | |
[Unit] | |
Description=Deluge Bittorrent Client Daemon | |
After=network-online.target | |
[Service] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: noah huetter - dlatch.com | |
# | |
# v2: | |
# - added database backup | |
# - partial file transfer for no big file junk on /tmp | |
# v3: | |
# - Variables for user settings | |
# - Comments and functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GitLab Backup script | |
# Backup config | |
docker exec -t gitlab /bin/sh -c 'umask 0077; tar cfz /var/opt/gitlab/backups/$(date "+etc-gitlab-config-%s.tgz") -C / etc/gitlab' | |
# Backup data | |
sudo docker exec -t gitlab gitlab-rake gitlab:backup:create | |
# Delete old config | |
sudo find /srv/gitlab/data/backups/ -type f -name 'etc-gitlab-*' -mtime +30 -exec rm {} \; | |
# Copy to backup server | |
sudo rsync -rvz --delete "/srv/gitlab/data/backups" "/media/beeblebroxgitlab/backup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Outside port to be openned for incomming ssh connections | |
PORT=12322 | |
# Host Name and Port of the announce destination using SSH | |
HOST=host.com | |
HOST_PORT=22 | |
curl -s http://whatismyip.akamai.com/ | ssh outpost@$HOST -p$HOST_PORT "cat > ~/outpost_ip.txt; echo ":$PORT" >> ~/outpost_ip.txt" | |
# Make sure port is forwarded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GPG Key to use for data encryption | |
KEY_ID=3387FFED | |
# Host | |
HOST=`cat /var/services/homes/outpost/outpost_ip.txt` | |
USER=pi | |
if [ $# -ne 2 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GPG Key to use for data encryption | |
KEY_ID=3387FFED | |
# Host | |
HOST=`cat /var/services/homes/outpost/outpost_ip.txt` | |
USER=pi | |
# Check for input arguments | |
if [ $# -ne 2 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gpg2syno='/usr/local/gnupg/bin/gpg2' | |
# List keys | |
gpg2syno --list-keys | |
# Export private key | |
KEY_ID=12345678 | |
gpg2syno -a --export-secret-keys $KEY_ID > secret-gpg.key | |
# Export public key |
OlderNewer