Skip to content

Instantly share code, notes, and snippets.

View gytisrepecka's full-sized avatar

Gytis Repečka gytisrepecka

View GitHub Profile
@kareiva
kareiva / pingpong.pas
Last active December 1, 2021 17:35
This code is 20yrs old, but it somewhat works with ptcgraph unit
{
��������������������������ͻ
�Simonas Kareiva �
� 2000 12 22 6:30 AM �
� PinGPonG v0.01 �
� questions:molotov@mp3.lt �
��������������������������ͼ
}
program pingpong;
uses Crt, ptcgraph;
<!-- contents of render-image.html -->
{{- $link := split .Destination "#" }}
{{- $image := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (index $link 0)) }}
{{- $logo := (resources.Get "images/logo.png") }}
{{- if and $image $logo }}
{{- $size := math.Round (mul $image.Height 0.25) }}
{{- $size := cond (ge $size 80) ($size) (80.0) }}
{{- $logo := $logo.Resize (printf "%.0fx jpg" $size) }}
/*
* m1racle-poc: a basic proof of concept for the M1RACLES vulnerability in the Apple M1.
*
* This program allows you to read and write the state of the s3_5_c15_c10_1 CPU register.
*
* Please visit m1racles.com for more information.
*
* Licensed under the MIT license.
*/
@quiver
quiver / iam-policy.json
Last active April 23, 2024 07:02
How to connect to Amazon RDS PostgreSQL with IAM credentials
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name"
@pcgeek86
pcgeek86 / Car Manufacturers.json
Last active June 4, 2024 07:46
Plain-text list of major car manufacturers
[
"Abarth",
"Alfa Romeo",
"Aston Martin",
"Audi",
"Bentley",
"BMW",
"Bugatti",
"Cadillac",
"Chevrolet",
@rigelk
rigelk / peertube.conf
Last active April 30, 2024 13:40
a now OUTDATED httpd/Apache vhost to run PeerTube | note that only Nginx is supported by the PeerTube team, and with this or any other Apache configuration, you will likely get NO SUPPORT.
# requires WebSocket support with `a2enmod proxy_wstunnel`
# check https://ssl-config.mozilla.org/#server=apache&version=2.4.41&config=modern&openssl=1.1.1d&hsts=false&ocsp=false&guideline=5.6 for hardening security
<VirtualHost *:80 [::]:80>
ServerName peertube.example.com
ServerAdmin webmaster@example.com
Protocols h2c http/1.1
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@cmiles74
cmiles74 / social.conf
Created April 5, 2017 20:36
Mastodon Configuration for Apache
<IfModule mod_ssl.c>
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName social.example.com
@kuznero
kuznero / vdi-file-compacting.md
Last active June 9, 2024 08:42
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile
Let [tag] = any tag in upstream repo
git fetch upstream --tags
git push origin --tags