Skip to content

Instantly share code, notes, and snippets.

View jamesattard's full-sized avatar

James A. jamesattard

View GitHub Profile
@jamesattard
jamesattard / gist:51240a9a60ca6bf9513e
Last active March 20, 2024 14:09
Fix Permissions and Refresh KExt cache
echo "Fixing ownership and permissions..."
chmod -R 755 /System/Library/Extensions/*
chown -R root:wheel /System/Library/Extensions/*
chown root:admin /
echo "Rebuilding kext cache..."
kextcache -system-prelinked-kernel
kextcache -system-caches
@jamesattard
jamesattard / docker-intro-session-ex-1.ps1
Last active April 16, 2023 04:08
Docker Intro Session Exercise #1
# In this exercise we are going through the Docker fundamental commands.
# After completing this lab, you are expected to know how to:
#
# a. find Docker images
# b. run containers
# c. stop containers
# d. delete containers
#
# Docker Intro Session Lab - James Attard (2019)
@jamesattard
jamesattard / timeseries_binning.py
Created August 30, 2017 07:45
Pandas binning over timeseries
from datetime import datetime
from datetime import date
import numpy as np
import pandas as pd
data = {
'date': ['2014-05-01', '2014-05-01', '2014-05-02', '2014-05-02', '2014-05-02', '2014-05-03', '2014-05-03', '2014-05-04', '2014-05-04', '2014-05-08'],
'score': [34, 25, 26, 15, 15, 14, 26, 25, 62, 41]
}
<html lang="en">
<body><noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="text/javascript" src="http://localhost/main.c9cd54b9.chunk.js"></script>
</body>
</html>
# Functions
function enc() { gpg --output $1.e --encrypt --recipient info@jamesattard.com $1; }
function dec() { gpg --output $1 --decrypt $1.e; }
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="logo192.png" />
<html>
Hello World
</html>
@jamesattard
jamesattard / cra.sh
Created August 14, 2019 07:29
create-react-app
$ create-react-app hello-react
# Remove foreman
yum remove foreman foreman-installer foreman-proxy
rm -rf /var/lib/foreman /usr/share/foreman /usr/share/foreman-proxy/logs
# Remove puppet
yum remove puppet puppetmaster puppet-common puppetmaster-common puppetlabs-release
rm -rf /usr/lib/ruby/vendor_ruby/puppet /usr/share/puppet /var/lib/puppet /etc/puppet
@jamesattard
jamesattard / Dockerfile
Last active June 10, 2019 06:23
Docker Intro Session Exercise #2
FROM mcr.microsoft.com/powershell:6.2.1-nanoserver-1803
COPY HelloWorld.ps1 /
CMD ["pwsh", "HelloWorld.ps1"]