Skip to content

Instantly share code, notes, and snippets.

View functionoffunction's full-sized avatar
🖖
live long and prosper

Timi functionoffunction

🖖
live long and prosper
View GitHub Profile
@functionoffunction
functionoffunction / httpd_conf_creator.sh
Last active June 28, 2023 14:57
Create domain apache conf
#!/bin/bash
domains=$1
conf_root=$2
if [ -z "$domains" ]; then
echo "No domain list provided. Please provide a comma-separated list of domains."
exit 1
fi
@functionoffunction
functionoffunction / 001-default.conf
Last active June 28, 2023 13:35
Reverse proxy vhost for mattermost
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t>
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName example.com
@functionoffunction
functionoffunction / _default.js
Created June 18, 2023 18:41
Make nextjs static load urls directly on servers eg apache, s3, etc
// on_default.js your default page and wait for the magic
import { useEffect, useState } from 'react';
import router from 'next/router';
import NotFound from './404';
export default function Default(){
const [isPage404, setIsPage404] = useState(false);
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:GetAccountSummary",
"iam:ListVirtualMFADevices",
@functionoffunction
functionoffunction / curiousPersionAllowCIPolicy
Last active July 28, 2022 09:02
curiousPersionAllowCIPolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowListS3StateBucket",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::farmz2u-curious-person-tfstate"
},
{
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y
apt-get -y install build-essential wget curl gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev zlib1g-dev
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.39-9772-beta/softether-vpnserver-v4.39-9772-beta-2022.04.26-linux-x64-64bit.tar.gz
tar xzf softether-vpnserver-v4.39-9772-beta-2022.04.26-linux-x64-64bit.tar.gz && rm softether-vpnserver-v4.39-9772-beta-2022.04.26-linux-x64-64bit.tar.gz
cd vpnserver && sudo make
cd ..
sudo mv vpnserver /usr/local && cd /usr/local/vpnserver/
sudo chmod 600 *
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName vpn-london-1.tradefarm.io
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TerraformRequiredPermissions",
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken",
"ec2:*",
"rds:DeleteDBSubnetGroup",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowViewAccountInfo",
"Effect": "Allow",
"Action": [
"iam:GetAccountPasswordPolicy",
"iam:GetAccountSummary",
"iam:ListVirtualMFADevices",
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"