Skip to content

Instantly share code, notes, and snippets.

View bright-spark's full-sized avatar
♥️
Tinkering with stuff!

martin. bright-spark

♥️
Tinkering with stuff!
View GitHub Profile
@bright-spark
bright-spark / kasm_cert.sh
Created September 15, 2024 00:51 — forked from m-triassi/kasm_cert.sh
Generate an SSL certificate for a KASM instance. Requires Certbot & Docker to be installed.
#!/usr/bin/env bash
# Leverages Docker containers to create a temporary signing server
# Obtain a SSL cert and then apply it to the service in question we're interested in
# Usage: ./kasm_cert.sh mydomain.test
mkdir -p /tmp/webroot
# Start an ephemeral nginx container
@bright-spark
bright-spark / Install KASM Workspace.sh
Created September 11, 2024 01:38 — forked from Udara-Dananjaya/Install KASM Workspace.sh
Build Kasm Workspace on Ubuntu: Setup swap, firewall, hostname & Kasm installation with SSL. Simplify secure virtual workspaces!
# Gain superuser privileges
sudo -i
# Create swap area for managing memory
sudo dd if=/dev/zero bs=1M count=5024 of=/mnt/swapfile.swap
sudo chmod 600 /mnt/swapfile.swap
sudo mkswap /mnt/swapfile.swap
sudo swapon /mnt/swapfile.swap
echo '/mnt/swapfile.swap swap swap defaults 0 0' | sudo tee -a /etc/fstab
@bright-spark
bright-spark / squid.conf
Last active August 27, 2023 22:28 — forked from kipyegonmark/squid.conf
Sample configuration for squid proxy server. Source here -> https://calomel.org/squid.html
#
### Calomel.org Squid squid.conf
#
########### squid.conf ###########
#
## interface, port and proxy type
#http_port 10.10.10.1:8080 transparent
http_port 10.10.10.1:8080
## general options

Push Only dist/ Folder To Live Server

I have googled many things and explored many questions on Stack Overflow to find the best way to push only dist/ directory to live server. I couldn't find any good solution but one person on Stackoverflow suggested to look at Git Submodules and this is the best solution I could come up with. I have never heard of submodules before because almost nobody uses them. If you never heard of it too then I'll first explain what a submodule is and then I'll show you how you can use submodules to push only dist/ directory to a live server.

@bright-spark
bright-spark / web-servers.md
Created December 18, 2021 22:16 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@bright-spark
bright-spark / .. MediaCreationTool.bat ..md
Created November 6, 2021 13:49 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support

We did it! We broke gist.github.com ;) So head over to the new home! Thank you all!
2021.10.20: https://github.com/AveYo/MediaCreationTool.bat now open for interaction

  • new update introducing no 11 setup checks on boot in VirtualBox

Not just an Universal MediaCreationTool wrapper script with ingenious support for business editions,
Preview
A powerful yet simple windows 10 / 11 deployment automation tool as well!

configure via set vars, commandline parameters or rename script like iso 21H2 Pro MediaCreationTool.bat
recommended windows setup options with the least amount of issues on upgrades set via auto.cmd

@bright-spark
bright-spark / php.ini
Created September 10, 2021 13:58 — forked from adrienne/php.ini
PHP .ini file
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@bright-spark
bright-spark / sphp.sh
Created January 19, 2021 19:32 — forked from rhukster/sphp.sh
Easy Brew PHP version switching
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
osx_patch_version=${osx_patch_version:-0}
osx_version=$((${osx_major_version} * 10000 + ${osx_minor_version} * 100 + ${osx_patch_version}))
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
@bright-spark
bright-spark / browser-detect.js
Created September 29, 2018 23:31 — forked from devfred/browser-detect.js
javascript: Browser Detection
(function( undefined ){
/* Apple Device Webkit Browsers */
var isIdevice = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
if (isIdevice){
document.getElementsByTagName('body')[0].className += ' iphone ipod ipad';
}
var isIphone = /(iPhone).*AppleWebKit/i.test(navigator.userAgent);
if (isIphone){
document.getElementsByTagName('body')[0].className += ' iphone';