Skip to content

Instantly share code, notes, and snippets.

@alixaxel
alixaxel / README.md
Last active June 15, 2023 15:33 — forked from Techwolf12/README.md
Generating IPv6 PTR records from a Bind9 zonefile using Bash

Generating IPv6 PTR records from a Bind9 Zonefile using Bash.

The following script takes a Bind9 zonefile, gets all AAAA records from it and generated PTR records based on them.

What you need to do:

  1. Edit the Zone header in the script.
  2. Run the script with ./generate_v6_ptr.sh /path/to/zonefile.zone

This will output the zones on STDOUT. If you want to save this to a zonefile, you can use this example:

@alixaxel
alixaxel / unresponsive.css
Last active December 29, 2022 03:57
Bootstrap Unresponsive Override
body.unresponsive {
min-width: 960px;
}
body.unresponsive .container {
max-width: none !important;
width: 960px !important;
}
body.unresponsive [class^="col-"] {
float: left;
}
@alixaxel
alixaxel / example.php
Created July 19, 2012 23:09 — forked from xeoncross/index.php
MySQL database relations
<?php
/*
* What about asking PHP to figure out the relation path!???? AWESOME!
*/
// url.user_id -> belongs_to -> users.id
$start = 'vote'; // We have a vote
$end = 'user'; // We have a user

Keybase proof

I hereby claim:

  • I am alixaxel on github.
  • I am alixaxel (https://keybase.io/alixaxel) on keybase.
  • I have a public key whose fingerprint is 8F12 0F1F E592 5538 79AB 72FB 3C70 80FE 5956 1D22

To claim this, I am signing this object:

@alixaxel
alixaxel / sqlite.udf.like.icu.php
Last active September 22, 2021 19:03
SQLite UDFs for LIKE Operator Overloading
<?php
$db->sqliteCreateFunction('like',
function ($pattern, $data, $escape = null) use ($db)
{
static $modifiers = null;
if (isset($modifiers) !== true)
{
$modifiers = ((strncmp($db->query('PRAGMA case_sensitive_like;')->fetchColumn(), '1', 1) === 0) ? '' : 'i') . 'suS';
#!/usr/bin/env bash
export PATH="$PATH:/srv/source/depot_tools"
mkdir -p /srv/{build,source}/chromium
cd /srv/source && \
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd /srv/source/chromium && \
@alixaxel
alixaxel / smoothing.go
Created February 26, 2017 00:56 — forked from xeoncross/smoothing.go
Peak detection "Smoothed z-score algo" (in Golang) from http://stackoverflow.com/a/22640362/99923
/*
Settings (the ones below are examples: choose what is best for your data)
set lag to 5; # lag 5 for the smoothing functions
set threshold to 3.5; # 3.5 standard deviations for signal
set influence to 0.5; # between 0 and 1, where 1 is normal influence, 0.5 is half
*/
// ZScore on 16bit WAV samples
func ZScore(samples []int16, lag int, threshold float64, influence float64) (signals []int16) {
//lag := 20
BM25.Tokenize = function(text) {
text = text
.toLowerCase()
.replace(/\W/g, ' ')
.replace(/\s+/g, ' ')
.trim()
.split(' ')
.map(function(a) { return stemmer(a); });
// Filter out stopStems

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

Keybase proof

I hereby claim:

  • I am alixaxel on github.
  • I am alixaxel (https://keybase.io/alixaxel) on keybase.
  • I have a public key ASByJIuLrcv6bdlxnlrycvOu9ISNgB4hncrIinlv3WFfAQo

To claim this, I am signing this object: