Skip to content

Instantly share code, notes, and snippets.

@lichnak
lichnak / excerpt-ssg-rhel6-oval.xml
Created May 11, 2018 07:21 — forked from gregelin/excerpt-ssg-rhel6-oval.xml
Comparison of SCAP-Security-Guide XCCDF and OVAL XML to EasySCAP YAML version
<definition class="compliance" id="oval:ssg:def:671" version="1">
<metadata>
<title>Verify /etc/passwd Permissions</title>
<affected family="unix">
<platform>Red Hat Enterprise Linux 6</platform>
</affected>
<description>This test makes sure that /etc/passwd is owned by 0, group owned by 0, and has mode 0644. If
the target file or directory has an extended ACL then it will fail the mode check.</description>
<reference source="swells" ref_id="20130831" ref_url="test_attestation"/>
<reference source="ssg" ref_id="file_permissions_etc_passwd"/></metadata>
@lichnak
lichnak / install.bash
Created May 27, 2018 12:56 — forked from isc30/install.bash
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
@lichnak
lichnak / vm-backup.sh
Created June 18, 2018 16:52 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@lichnak
lichnak / How_To_Install_Oracle_DB-Server_CentOS
Created June 22, 2018 07:57 — forked from hogihung/How_To_Install_Oracle_DB-Server_CentOS
Installing Oracle 11G Express on CentOS 6.x
--------------------------------------------------------------------------------
Author: John F. Hogarty
Create Date: 08/12/2014 @ 05:00pm est
Modified Date: 08/15/2014 @ 08:47am est
Subject: Installing Oracle Database 11g Express for CentOS 6.x
--------------------------------------------------------------------------------
1. sudo su -
@lichnak
lichnak / GenerateHexFloor.cs
Created June 26, 2018 05:18 — forked from LuxGiammi/GenerateHexFloor.cs
Generation of an hexagon tiled floor - implementation in Unity3D
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GenerateHexFloor : MonoBehaviour {
public GameObject Hexagon;
public uint Radius;
public float HexSideMultiplier = 1;
@lichnak
lichnak / tutorial.md
Created July 17, 2018 06:08 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@lichnak
lichnak / audit.rules
Created July 19, 2018 12:28 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
"""
main.py
That's it this is the entire API.
"""
from flask import Flask, jsonify
import markovify
app = Flask(__name__)
with open("nietzche.txt") as f:
text = f.read()
@lichnak
lichnak / gist:63a1347e7b607e9ec267f9fa2b41433b
Created August 27, 2018 09:38 — forked from sjlombardo/gist:2068863
500x PBKDF2-HMAC-SHA256 vs 4000x PBKDF2-HMAC-SHA1

Assumptions:

  • PBKDF2 with HMAC-SHA1 must execute SHA1 iterations twice to generate a 256 bit key (digest size is < derived key size)
  • Each HMAC-SHA1 operation executes two internal SHA1 operations.
  • Thus, 4000 iterations of PBKDF2 using HMAC-SHA1 requires 16,000 SHA1 operations
  • PBKDF2 with HMAC-SHA256 executes 1 SHA1 operations per iteration to generate a 256 bit key (digest size = derived key size)
  • Each HMAC-SHA256 operation executes two internal SHA256 operations.
  • Thus, 500 iterations of PBKDF2 using HMAC-SHA256 requires 1000 SHA-256 operations (1/16th the number of operations)
  • SHA256 is slower than SHA1, though it's difficult to get exact benchmarks. For ease of caclulations let us assume that on a GPU, SHA1 is twice as fast as SHA256 (potential sources: http://hashcat.net/oclhashcat-lite/, http://www.insidepro.com/eng/egb.shtml)