Skip to content

Instantly share code, notes, and snippets.

@VictorTaelin
VictorTaelin / fast_scansum.cu
Created April 9, 2024 21:22
Fast CUDA block-local prefix sum (scamsun) using warp sync primitives (__shfl_up_sync)
// Fast block-local prefix-sum on CUDA, using warp-syncs.
// The input is an array of u32. It is mutated in place. Example:
// arr = [1,1,1,1,...]
// Becomes:
// arr = [1,2,3,4,...]
// The number of elements must be equal to threads per block (TPB).
#include <stdio.h>
#include <cuda_runtime.h>
@alexalouit
alexalouit / collectd-fail2ban
Created September 9, 2014 13:58
Collectd: Fail2ban
LoadPlugin tail
<Plugin "tail">
<File "/var/log/fail2ban.log">
Instance "fail2ban"
<Match>
Regex "Ban"
DSType "CounterInc"
Type "counter"
Instance "fail2ban-ban"
</Match>
@tokoiwesley
tokoiwesley / Install PHP 7.1 on Debian Stretch
Last active April 24, 2024 06:04
How To Install Php 7.1 On Debian
# Add Repository to your system (ondrej/php PPA)
sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
# Install PHP 7.1
sudo apt install php7.1
— Да?
— Алё!
— Да да?
— Ну как там с деньгами?
— А?
— Как с деньгами-то там?
— Чё с деньгами?
— Чё?
— Куда ты звонишь?
@davegreenwood
davegreenwood / triangulation.py
Created September 16, 2018 10:18
Triangulate image points to world points comparing openCV to pure python.
from __future__ import print_function
import numpy as np
import cv2
import time
np.set_printoptions(formatter={'float': '{: 0.3f}'.format})
def triangulate_nviews(P, ip):
"""
@SahilMahadwar
SahilMahadwar / bing-wallpaper.sh
Last active April 24, 2024 06:00
You can use this script to automatically set Bing's image of the day as your wallpaper. It downloads the image and saves it to a chosen folder. It also keeps track of downloaded images using a JSON file, so it won't download the same one twice. Just set it to run on every login to keep your wallpaper fresh!
#!/bin/bash
# Fetch wallpaper from the API - https://github.com/TimothyYe/bing-wallpaper
api_url="https://bing.biturl.top/?resolution=3840&format=json&index=0&mkt=zh-CN"
response=$(curl -s "$api_url")
# Parse JSON response
start_date=$(echo "$response" | jq -r '.start_date')
end_date=$(echo "$response" | jq -r '.end_date')
image_url=$(echo "$response" | jq -r '.url')
@ChakshuGautam
ChakshuGautam / stencil.repo-structure.md
Created April 19, 2024 09:17
Stencil Repo Structure

Monorepo

readme.md
/docs
/packages (npm)
      /molecules
           package.json
      /pages
           package.json
 /providers
@Daan-Grashoff
Daan-Grashoff / google_search_maps_addon.js
Last active April 24, 2024 05:55
Bring back the google maps button when searching on google
// ==UserScript==
// @name Google maps addon
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Bring google maps button back
// @author You
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@rtyler
rtyler / Jenkinsfile
Last active April 24, 2024 05:54
Docker in docker within Jenkins on Kubernetes. Eat at Arby's.
pipeline {
agent {
kubernetes {
label 'dind'
defaultContainer 'docker'
yaml """
---
apiVersion: v1
kind: Pod
metadata: