Skip to content

Instantly share code, notes, and snippets.

View xuyuji9000's full-sized avatar

Karl Xu xuyuji9000

  • Shanghai, China
View GitHub Profile
#!/usr/bin/env python
"""
SFRP script for Linux vms to install rssh package
"""
import os
import os.path
import imp
import time
import subprocess
@sapessi
sapessi / README.md
Last active October 26, 2021 10:48
Continuous deployment of React websites to Amazon S3

Continuous deployment of React websites to Amazon S3

This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.

Files included

  • buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repository
  • configure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).
  • index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in a s3-deployment-custom-resource sub-folder of the repo
  • app-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu
@mcfdn
mcfdn / Multiple Deploy Keys in GitHub.md
Last active November 21, 2022 14:02
Using multiple GitHub deploy keys on a single server with a single user

Using multiple GitHub deploy keys on a single server with a single user

Within GitHub it is possible to set up two types of SSH key - account level SSH keys and and repository level SSH keys. These repository level SSH keys are known in GitHub as deploy keys.

Deploy keys are useful for deploying code because they do not rely on an individual user account, which is susceptible to change, to “store” the server keys.

There is, however, an ‘issue’ with using deploy keys; each key across all repositories on GitHub must be unique. No one key can be used more than once. This becomes a problem when deploying to repositories to the same server with the same user. If you create two keys, the SSH client will not know which key to use when connecting to GitHub.

One solution is to use an SSH config file to define which key to use in which situation. This isn’t as easy as it seems.. you might try something like this:

@SteveHoggNZ
SteveHoggNZ / gist:cd3855a329632a3c3934adb80a5a646d
Created December 2, 2016 00:02
CloudFormation / Nested stack example
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Master template that includes nested templates",
"Parameters": {
"DeployBastion": {
"Description": "Should a bastion server be deployed?",
"Default": "No",
"Type": "String",
"AllowedValues": ["No", "Yes"]
}
@mgeeky
mgeeky / forticlientsslvpn-expect.sh
Last active April 15, 2024 07:30
Simple script intended to automate Fortinet SSL VPN Client connection on Linux using expect scripting.
#!/bin/bash
# Forticlient SSL VPN Client launching script utilizing expect.
# --------------------------------------------
# CONFIGURATION
# If empty - script will take some simple logic to locate appropriate binary.
FORTICLIENT_PATH=""
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@dobaduc
dobaduc / aliyuncli-ecs.md
Last active September 4, 2018 12:36
Getting started with Aliyun ECS API

Installation

Check out the guideline here: https://github.com/aliyun/aliyun-cli ( using Google translator)

Install python pip if necessary

curl https://bootstrap.pypa.io/get-pip.py | sudo python

Install aliyuncli

@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@andyshinn
andyshinn / composer.json
Last active February 18, 2024 12:05
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@githubutilities
githubutilities / README.md
Last active October 21, 2022 02:23
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start