Skip to content

Instantly share code, notes, and snippets.

nick kuzmik kuzmik

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am kuzmik on github.
  • I am kuzmik (https://keybase.io/kuzmik) on keybase.
  • I have a public key whose fingerprint is EAF1 3774 11D4 37C2 D704 1AC5 69FF 6150 957C E85C

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am kuzmik on github.
  • I am kuzmik (https://keybase.io/kuzmik) on keybase.
  • I have a public key whose fingerprint is E6BE BFCB 797B B5D1 79FE 7966 7E9C C486 05CB 1E24

To claim this, I am signing this object:

View sentry.sql
SELECT
(sentry_groupedmessage.first_seen) AS `sort_by`,
`sentry_groupedmessage`.`id`,
`sentry_groupedmessage`.`project_id`,
`sentry_groupedmessage`.`logger`,
`sentry_groupedmessage`.`level`,
`sentry_groupedmessage`.`message`,
`sentry_groupedmessage`.`view`,
`sentry_groupedmessage`.`num_comments`,
`sentry_groupedmessage`.`platform`,
View explain.sql
kuzmik:sentry_production> describe SELECT (sentry_groupedmessage.first_seen) AS `sort_by`, `sentry_groupedmessage`.`id`, `sentry_groupedmessage`.`project_id`, `sentry_groupedmessage`.`logger`, `sentry_groupedmessage`.`level`, `sentry_groupedmessage`.`message`, `sentry_groupedmessage`.`view`, `sentry_groupedmessage`.`num_comments`, `sentry_groupedmessage`.`platform`, `sentry_groupedmessage`.`status`, `sentry_groupedmessage`.`times_seen`, `sentry_groupedmessage`.`last_seen`, `sentry_groupedmessage`.`first_seen`, `sentry_groupedmessage`.`first_release_id`, `sentry_groupedmessage`.`resolved_at`, `sentry_groupedmessage`.`active_at`, `sentry_groupedmessage`.`time_spent_total`, `sentry_groupedmessage`.`time_spent_count`, `sentry_groupedmessage`.`score`, `sentry_groupedmessage`.`is_public`, `sentry_groupedmessage`.`data`, `sentry_groupedmessage`.`short_id`, `sentry_project`.`id`, `sentry_project`.`slug`, `sentry_project`.`name`, `sentry_project`.`forced_color`, `sentry_project`.`organization_id`, `sentry_project`.`te
View ban fuckers.sh
#!/bin/bash
# The fuckfaces ipset will hold any ip that appears to be portscanning or brute forcing ssh connections.
ipset -q create fuckfaces hash:ip counters
zgrep "Bad protocol" /var/log/auth.* | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort | uniq | xargs -I{} ipset -q add fuckfaces {}
zgrep "Did not receive identification string from" /var/log/auth.* | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort | uniq | xargs -I{} ipset -q add fuckfaces {}
zgrep "Invalid user" /var/log/auth.* | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort | uniq | xargs -I{} ipset -q add fuckfaces {}
# buuuut remove anyone from the list who has a pk that works, just in case.
zgrep "Accepted publickey" /var/log/auth.log* | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort | uniq | xargs -I{} ipset -q del fuckfaces {}
View commission junction.rb
def self.product_search(str)
key = 'YOUR_KEY'
pid = 'YOUR_PID'
cj = CommissionJunction.new(key, pid)
items = cj.product_search(
'keywords' => str.split(' ').reduce('') { |keywords, s| keywords += " +#{s}" },
'serviceable-area' => 'us',
'advertiser-ids' => '2045991, 3379721, 1461363, 3449087, 3055640',
'currency' => 'usd',
View sl csv parser.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Script.Serialization;
using Cotdom.Cobalt;
@kuzmik
kuzmik / catalog.sql
Last active Aug 17, 2017
how NOT to design a database, courtesy your friends at Nexagen USA dot com
View catalog.sql
CREATE TABLE [dbo].[Catalog](
[SKU] [nvarchar](15) NOT NULL,
[brief_en_US] [varchar](100) NULL,
[highdescription_en_US] [ntext] NULL,
[lowdescription_en_US] [ntext] NULL,
[shipdescription_en_US] [varchar](100) NULL,
[brief_es_PR] [varchar](100) NULL,
[highdescription_es_PR] [ntext] NULL,
[lowdescription_es_PR] [ntext] NULL,
[BV] [int] NULL,
@kuzmik
kuzmik / 850.cs
Created Aug 8, 2017
XML EDI parser
View 850.cs
public void ParseFile()
{
if (!this.hasdeliveries)
return;
XDocument data = XDocument.Load(this.file.FullName);
var q = from x in data.Elements("TRANSFER").Elements("MESSAGE")
select x.Value;
@kuzmik
kuzmik / fuck systemd.sh
Last active Jan 10, 2018
srsly fuck systemd
View fuck systemd.sh
apt install -y sysvinit-core locate
cp /usr/share/sysvinit/inittab /etc/inittab
echo -e 'Package: *systemd*\nPin: release *\nPin-Priority: -1\n' > /etc/apt/preferences.d/eat-shit-systemd
echo -e 'Package: libsystemd0\nPin: version *\nPin-Priority: 500\n' >> /etc/apt/preferences.d/eat-shit-systemd
reboot
apt remove -y --purge --auto-remove systemd dbus libdbus-1-3
apt update
You can’t perform that action at this time.