Skip to content

Instantly share code, notes, and snippets.

View alhafoudh's full-sized avatar

Ahmed Al Hafoudh alhafoudh

View GitHub Profile
---
apiVersion: v1
kind: Pod
metadata:
name: gpu-test
namespace: default
spec:
tolerations:
- key: nvidia.com/gpu
operator: Exists
#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive
DISTRO=debian10
CUDA_KEYRING_DEB=cuda-keyring_1.0-1_all.deb
wget -O /tmp/${CUDA_KEYRING_DEB} https://developer.download.nvidia.com/compute/cuda/repos/${DISTRO}/x86_64/${CUDA_KEYRING_DEB}
Project.all.map do |p|
[
p,
total_size = p.container_repositories.reduce(0) do | acc, cr |
acc + cr.tags.reduce(0) do |acc,t| acc + ((t.total_size || 0) / 1024.0 / 1024.0)
end
end
]
end.sort_by(&:last).reverse.map do |(p, total_size)|
printf "%10.2f %s\n", total_size, p.name
# https://cardwerk.com/smart-card-standard-iso7816-4-section-6-basic-interindustry-commands/
alhafoudh@Gray:~/Projects/evrc$ opensc-explorer
OpenSC Explorer version 0.22.0
Using reader with a card: Gemalto PC Twin Reader
unable to change lifecycle: Security status not satisfied
OpenSC [3F00]> cd aid:A0000004564556522D3031
OpenSC [A000/0004/5645/5652/2D30/31]> find D000 D0FF
@alhafoudh
alhafoudh / rpi_emoji.sh
Last active June 21, 2024 14:20
Add support for emojis on Raspberry Pi
mkdir ~/tmp
cd tmp
wget https://fontsdata.com/zipdown-segoeuiemoji-132714.htm
wget https://noto-website.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip
mv zipdown-segoeuiemoji-132714.htm segoeuiemoji.zip
unzip segoeuiemoji.zip
unzip NotoColorEmoji-unhinted.zip
mkdir $HOME/.fonts &>/dev/null
mv seguiemj.ttf "$HOME/.fonts/Segoe UI.ttf"
mv NotoColorEmoji.ttf "$HOME/.fonts/Noto Color Emoji.ttf"
@alhafoudh
alhafoudh / package.json
Last active January 5, 2021 22:36
Tailwind Rails Scaffold
{
"dependencies": {
"@tailwindcss/aspect-ratio": "^0.2.0",
"@tailwindcss/forms": "^0.2.1",
"@tailwindcss/typography": "^0.3.1",
"autoprefixer": "^10.1.0",
"postcss": "^8.2.2",
"tailwindcss": "^2.0.1-compat"
},
"devDependencies": {}
/*
Usage:
CustomRoute(page: SomewPage, transitionsBuilder: CustomTransitions.withoutShadow)
*/
import 'dart:ui';
import 'package:flutter/foundation.dart';
@alhafoudh
alhafoudh / keycloak_openresty_auth.conf
Created January 12, 2018 22:35
keycloak openresty authentication
set $session_check_ssi off;
set $session_secret Eeko7aeb6iu5Wohch9Loo1aitha0ahd1;
set $session_storage cookie;
access_by_lua_block {
local opts = {
redirect_uri_path = "/auth",
discovery = "https://keycloak.freevision.sk/auth/realms/rancher-elk/.well-known/openid-configuration",
client_id = "nginx",
client_secret = "2cfde6f9-4283-456a-9f13-1b803482db9a"
class Throttler
attr_reader :period
attr_reader :value
attr_reader :block
def initialize(period)
@period = period
@first_time = nil
@value = nil
@block = proc { }
apiVersion: v1
kind: PersistentVolume
metadata:
name: test-volume
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath: