Skip to content

Instantly share code, notes, and snippets.

@emk
emk / apache-logs-hive.sql
Created January 3, 2012 18:01
Apache log analysis with Hadoop, Hive and HBase
-- This is a Hive program. Hive is an SQL-like language that compiles
-- into Hadoop Map/Reduce jobs. It's very popular among analysts at
-- Facebook, because it allows them to query enormous Hadoop data
-- stores using a language much like SQL.
-- Our logs are stored on the Hadoop Distributed File System, in the
-- directory /logs/randomhacks.net/access. They're ordinary Apache
-- logs in *.gz format.
--
-- We want to pretend that these gzipped log files are a database table,
@jbtule
jbtule / AESGCM.cs
Last active October 21, 2024 22:04
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;

Using auto-generated UTM tagged URLs within Google AdWords along with auto-tagging for Google Analytics

The Challenge

You want to use Google AdWords' auto-tagging for a deep integration with Google Analytics, but you need to use UTM parameters with your other analytics and marketing systems, but don't want to manually tag all of your ads.

The Solution

Within AdWords, you can use ValueTrack and custom parameters along with a tracking template to automatically generate a tagged URL with all of the information you need. A tracking template which populates the query string with campaignid, adgroupid and keywork looks like this:

{lpurl}?campaignid={campaignid}&adgroupid={adgroupid}&term={keyword}

@firelightning13
firelightning13 / [GUIDE] GPU Passthrough for Laptop with Fedora.md
Last active November 5, 2024 18:29
[GUIDE] GPU Passthrough for Laptop with Fedora

Running Windows 10/11 Guest with GPU Passthrough using laptop running Fedora

Abstract

This is a full guide for people who wanted to set up Windows 10/11 VM with QEMU/KVM hypervisor enhancements for a laptop that is configured with hybrid graphics card like Intel/AMD + NVIDIA. This process will take about 1 to 2 hours, depending on your system's performance and your patience =)

There is another comprehensive guide you can follow here (shoutout to asus-linux team who made supergfxctl which is a very important tool for this guide). It is more up-to-date than mine. I would probably incorporate those information into my guide, but you are welcome to use this one as a reference!

Before we proceed:

  • This guide is exclusively for Fedora users because this distro is quite different to set up than other distro such as Arch. I would say Arch is easier to setup than Fedora, but sometimes you like to use Fedora than Arc