Skip to content

Instantly share code, notes, and snippets.

View Mikescops's full-sized avatar
🐯
Hey

Corentin Mors Mikescops

🐯
Hey
View GitHub Profile
@xiaohutai
xiaohutai / bolt-ckeditor.md
Created November 14, 2017 11:16
Set custom tags in Bolt CKEditor

In app/config/config.yml:

wysiwyg:
    (...)
    ck:
        (...)
        format_tags: "p;h2;h3;h4;info;warning;error;success"
        format_info: { name: "Info", element: "p", attributes: { 'class': 'info' } }
 format_warning: { name: "Warning", element: "p", attributes: { 'class': 'warning' } }
@ageis
ageis / systemd_service_hardening.md
Last active December 31, 2025 01:23
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@lukecampbell
lukecampbell / create_ca.sh
Last active May 2, 2022 09:15
Generic script to create openssl based Certificate Authority
#!/bin/bash
set -e
echo "Creating new OpenSSL Certificate Authority"
echo -n "Enter path to CA [.]: "
read ca_path
ca_path=${ca_path:-$PWD}
if [[ "$ca_path" != /* ]]; then
ca_path="$PWD/$ca_path"
@ravibhure
ravibhure / git_rebase.md
Last active October 21, 2025 14:16
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@DinoChiesa
DinoChiesa / httpsig-in-postman-pre-request-script.js
Created January 26, 2016 23:18
pre-request script for Postman, to perform HttpSignature calculation. Also SHA-256 message digest.
function computeHttpSignature(config, headerHash) {
var template = 'keyId="${keyId}",algorithm="${algorithm}",headers="${headers}",signature="${signature}"',
sig = template;
// compute sig here
var signingBase = '';
config.headers.forEach(function(h){
if (signingBase !== '') { signingBase += '\n'; }
signingBase += h.toLowerCase() + ": " + headerHash[h];
});
@jasondavis
jasondavis / Demo-Usage.php
Last active September 26, 2021 22:05
Social Network Share Count for a URL - PHP Class
<?php
/*
Example Usage passing in Array of netowrks we want countsa for...
$socialCounts = new socialNetworkShareCount(array(
'url' => 'http://www.codedevelopr.com/',
'facebook' => true,
'twitter' => true,
'pinterest' => true,
@jctosta
jctosta / screen_cheatsheet.markdown
Last active December 10, 2025 02:31
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git