Skip to content

Instantly share code, notes, and snippets.

@JosepOli
JosepOli / whitelist.sh
Created November 8, 2023 15:58
Codigo para añadir enlaces a la whitelist de pihole
#!/bin/bash
# Set the name of your Pi-hole Docker container
PIHOLE_CONTAINER_NAME='pihole-unbound'
# Set the name of your txt file with the domains to whitelist
WHITELIST_FILE_NAME='lista.txt'
# Check if the file exists
if [ ! -f "$WHITELIST_FILE_NAME" ]; then
@docPhil99
docPhil99 / macFFmpeg.md
Last active April 30, 2024 20:43
Mac webcam FFmpeg

#Capture and stream a webcam To capture using the iSight camera on a Mac, or infact any other webcam connected to the Mac, we can use FFmpeg. First get a list of the devices installed.

ffmpeg -f avfoundation -list_devices true -i "" 

This will list the aviable video and audio devices.

The below will capture at 30fps and the set video size to a file. ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" out.avi

@hadees
hadees / arel_helpers.rb
Created March 5, 2016 05:41
Arel Helpers
module ArelHelpers
extend self
def self.included(base)
base.extend self
end
def asterisk(arel_table_or_model)
arel_table, columns = case arel_table_or_model
when Arel::Table
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Z-Index Example</title>
<style>
html, body { background-color: #00787F; }
.container {
position: relative;
@oSumAtrIX
oSumAtrIX / README.md
Last active April 30, 2024 20:38
Useful snippets for Discord

Discord console scripts

My collection of scripts for Discord.

Scripts

  • friend_invitelink.js: Generate a friend invite link
  • clientside_nitro.js: Spoof the client and enable client side Discord Nitro
@Killeroid
Killeroid / gpg-import-and-export-instructions.md
Created October 18, 2017 11:51
How to export and import gpg keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc

@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@FahimFBA
FahimFBA / OASIS_to_NIFTI_Fahim.sh
Created April 30, 2024 15:09
Converting OASIS brains MRI image files to NIFTI files
#!/bin/bash
# Directory where the OASIS data is located
ROOTDIR=/home/fahim/dataset
# Directory to save results
NIFTIDIR=${ROOTDIR}/../nifti
# Go to the directory with the data
cd ${ROOTDIR}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Z-Index Example</title>
<style>
html, body { background-color: #00787F; }
.container {
position: relative;