Skip to content

Instantly share code, notes, and snippets.

@kvaps
kvaps / rspamd-lists.md
Last active March 28, 2024 23:51
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@isogram
isogram / aria2c.md
Created February 13, 2016 19:26
aria2c command sample

Multiple torrent file download and sent it to background process

aria2c -j5 --max-upload-limit=2K file_1.torrent file_2.torrent file_3.torrent file_4.torrent file_5.torrent > aria2c.log 2>&1 &

@deepak
deepak / rakefile_extract_fixtures.rb
Created February 3, 2011 08:59
generate fixtures from actual data in database
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 23:47
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@JamieMac96
JamieMac96 / bashrc
Created January 1, 2023 21:02
CKA-Bashrc
alias k="kubectl"
alias v="vim"
function ns () {
kubectl config set-context --current --namespace=$1
}
export drc="--dry-run=client -oyaml"
export drs="--dry-run=server -oyaml"
@erfanoabdi
erfanoabdi / sparse_convertor.sh
Created August 6, 2017 04:34
sparseChunks to image Convertor for motorola images
#!/bin/sh
#SparseChunks to image Convertor for motorola images by Erfan Abdi
#special thanks to superR for header removal script
#make sure you have only one image with sparse chunks (system or oem)
echo "Converting all SparseChunks to Raw Image"
./simg2img *chunk* system.img.raw
echo "Removing Moto Header"
offset=$(LANG=C grep -aobP -m1 '\x53\xEF' system.img.raw | head -1 | gawk '{print $1 - 1080}')
dd if=system.img.raw of=system_moto.img ibs=$offset skip=1 2>&1
@rgiaviti
rgiaviti / UnidadeFederacao.java
Last active March 28, 2024 23:43
Enum Java com todas as Unidades da Federação do Brasil
/**
* Enum com todas as Unidades da Federação do Brasil. Contém o nome da Unidade, a sigla e a capital
* da Unidade da Federação. As unidades estão listadas por ordem alfabética no enum.
*
* @author Ricardo Giaviti
* @version 1.1.1
* @since 1.0.0
*/
public enum UnidadeFederacao {