Skip to content

Instantly share code, notes, and snippets.

Thomas Stachl tstachl

Block or report user

Report or block tstachl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View create_customer.rb
require 'desk_api'
DeskApi.configure do |config|
config.username = 'user@example.com'
config.password = 'Example1'
config.endpoint = 'https://sample.desk.com'
end
customer = DeskApi.customers.create({
first_name: 'Test',
@tstachl
tstachl / create_scratch_org
Created May 24, 2018
Create a new scratch org for SCMT development.
View create_scratch_org
#!/bin/bash
echo "Creating a new scratch org"
sfdx force:org:create -f config/project-scratch-def.json -a $1 --setdefaultusername --durationdays 30
sfdx scmt:audit:enable -u $1
echo "Pushing source"
sfdx force:source:push -f -u $1
sfdx force:user:permset:assign --permsetname SCMT_Audit -u $1
sfdx force:data:record:update -s User -w "firstname='User'" -v "UserPermissionsKnowledgeUser=true" -u $1
sfdx force:org:open -u $1
@tstachl
tstachl / .eslintrc.json
Last active Apr 24, 2018
Sane default eslintrc close to Salesforce DX.
View .eslintrc.json
{
"env": {
"browser": true
},
"parserOptions": {
"ecmaVersion": 5
},
"globals": {
"$A": true,
"AuraContext": true,
@tstachl
tstachl / Dockerfile
Created Feb 21, 2018
A custom Dockerfile to copy a config file into the image.
View Dockerfile
FROM nginx:alpine
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
@tstachl
tstachl / docker-compose.yml
Created Feb 21, 2018
A compose file containing the logging service via logsprout.
View docker-compose.yml
version: '3'
services:
logger:
image: gliderlabs/logspout
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
command: "syslog+tls://${PAPERTRAIL_URL}"
restart: always
@tstachl
tstachl / docker-compose.yml
Created Feb 21, 2018
File to test Docker Compose.
View docker-compose.yml
version: '3'
services:
nginx:
image: nginx:alpine
ports:
- '80:80'
- '443:443'
restart: always
@tstachl
tstachl / authy_ssh.sh
Created Feb 21, 2018
Steps to install Authy SSH CLI.
View authy_ssh.sh
# download the code from github
wget https://raw.githubusercontent.com/authy/authy-ssh/master/authy-ssh
# run the install
sudo bash authy-ssh install /usr/local/bin
# enable it
sudo /usr/local/bin/authy-ssh enable `whoami`
# test it
@tstachl
tstachl / restart_ssh_client.sh
Created Feb 20, 2018
After any changes to the SSH configuration the service needs to be restarted.
View restart_ssh_client.sh
sudo service ssh restart
@tstachl
tstachl / sshd_config
Last active Feb 20, 2018
My sshd_config with Root and Password access diabled.
View sshd_config
# /etc/ssh/sshd_config
# ...
# Authentication
LoginGraceTime 120
PermitRootLogin no
StrictModes yes
# ...
@tstachl
tstachl / ssh_setup.sh
Created Feb 20, 2018
Steps to set up SSH keys for a newly created user account on my VPS.
View ssh_setup.sh
# create the directory for ssh
mkdir -p ~/.ssh
# make sure it's editable only for the current user
chmod 700 ~/.ssh
# create the authorized keys file
touch ~/.ssh/authorized_keys
# use your favorite editor to add the public key
vim ~/.ssh/authorized_keys
You can’t perform that action at this time.