Skip to content

Instantly share code, notes, and snippets.

@atulkadian
atulkadian / setup.sh
Last active April 26, 2024 13:26
EC2 Setup for node apps
#!/bin/sh
# Copyright (C) 2024 Atul-Kadian
echo "Updating Packages ..."
sudo apt-get update
echo "Install Nginx ..."
sudo apt install nginx -y
echo "Installing Certbot ..."
package seed
import (
"log"
"github.com/jinzhu/gorm"
"github.com/victorsteven/fullstack/api/models"
)
var users = []models.User{
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 26, 2024 13:24
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@samsamm777
samsamm777 / gist:7230159
Last active April 26, 2024 13:24
PHP set private property value using reflection. This allows you to set a private property value from outside the object, great for PHPUnit testing.
<?php
$a = new A();
$reflection = new \ReflectionClass($a);
$property = $reflection->getProperty('privateProperty');
$property->setAccessible(true);
$property->setValue($a, 'new-value');
echo $a->getPrivateProperty();
//outputs:
@vaughany
vaughany / kill-pulse-vpn.sh
Last active April 26, 2024 13:24
Small script to kill the Pulse VPN service and UI, 'cos they seem to hang sometimes, for no reason.
#!/bin/bash
# Finds and kills the Pulse Secure VPN background service and UI.
if [[ $EUID -ne 0 ]]; then
echo -e "\e[1;41mThis script must be run as root.\e[0m"
exit 1
fi
IDS=$(ps -ax | grep -i 'pulse[ui|svc]' | tr -s ' ' | sed 's/^ *//g' | cut -d ' ' -f 1)
@nightuser
nightuser / use_existing_session.patch
Last active April 26, 2024 13:22
Use existing Xorg session for chrome-remote-desktop
Add an option to use the existing Xorg session with
chrome-remote-desktop.
The original idea of the patch: https://superuser.com/a/850359
--- a/chrome-remote-desktop 2024-03-27 16:03:20.518579015 +0000
+++ b/chrome-remote-desktop 2024-03-27 16:17:58.241912847 +0000
@@ -110,6 +110,8 @@
X_LOCK_FILE_TEMPLATE = "/tmp/.X%d-lock"
FIRST_X_DISPLAY_NUMBER = 20
@threedaymonk
threedaymonk / format.md
Last active April 26, 2024 13:21
Roland SP-404SX sample format

Roland SP-404SX sample file format

Notes

Field types are marked using C-style notation:

  • char[4] indicates a 4-byte fixed-width string
  • uint[6] indicates a 6-byte sequence
  • uint8, uint16, and uint32 are unsigned byte, short, and long integers
  • int8, int16, and int32 are signed byte, short, and long integers
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@netgfx
netgfx / App.tsx
Created August 20, 2021 21:47
complete-framer+supabase
import { ComponentType, useEffect } from "react"
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0"
import { createClient } from "https://cdn.skypack.dev/@supabase/supabase-js"
import { md5 } from "https://cdn.skypack.dev/pure-md5"
import { browser, checkUsername, checkPassword, useStore } from "./globals.ts"
// Learn more: https://www.framer.com/docs/guides/overrides/
export function initDB(Component): ComponentType {
@gabbhack
gabbhack / main.py
Created October 20, 2019 10:26
aiogram i18n example
from pathlib import Path
from typing import Tuple, Any
from aiogram import Bot, Dispatcher, executor, types
from aiogram.contrib.middlewares.i18n import I18nMiddleware
TOKEN = "TOKEN"
I18N_DOMAIN = "mybot"
BASE_DIR = Path(__file__).parent