Skip to content

Instantly share code, notes, and snippets.

View douglas-larocca's full-sized avatar

Douglas La Rocca douglas-larocca

View GitHub Profile
@douglas-larocca
douglas-larocca / ANSI.md
Created December 9, 2023 00:43 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
000(023Rb|001Rb)
001(017La|002Rb)
002(021La|003Rb)
003(021La|004La)
004(009Rb|005Lb)
005(004Ra|005La)
006(008La|007La)
007(009Rb|007La)
008(009Ra|008La)
009(010Ra|026Ra)
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 username"
exit 1
fi
username="$1"
json_left='{"input01":{"Input":"GmailAddress","GmailAddress":"'
@douglas-larocca
douglas-larocca / setupnewuser.ps1
Created January 15, 2018 17:42 — forked from theagreeablecow/setupnewuser.ps1
Setup New User in AD, Exchange and Lync
# This script will set up AD, User Directories, Exchange and Lync, using basic data retrived from a CSV file
# Requires the Active Directory module for Windows Powershell and appropriate credentials
# CSV file with corresponding header and user(s) info:
# Office,UserName,FirstName,LastName,Initial,Department,Role,Title,SetupSameAs,Manager,MailboxAccess,Extension,Mobile
#LOAD POWERSHELL SESSIONS
#------------------------
$exchangeserver = "exchange1.domain.com"
$Lyncserver = "lync1.domain.com.au"
@douglas-larocca
douglas-larocca / spectre.c
Created January 4, 2018 23:10 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@douglas-larocca
douglas-larocca / AES.c
Last active December 16, 2016 01:36 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mcrypt.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
int encrypt(void *buffer, int buffer_len, char *IV, char *key, int key_len) {
@douglas-larocca
douglas-larocca / client.go
Created August 2, 2016 06:29 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)