Skip to content

Instantly share code, notes, and snippets.

View dijit's full-sized avatar
:shipit:

Jan Harasym dijit

:shipit:
View GitHub Profile
@botcmd(split_args_with=None)
def insult(self, msg, args):
"""
Generate an insult.
"""
verbs = [
"lazy",
"stupid",
"insecure",
"idiotic",
use virt::connect::Connect;
use std::time::Duration;
use crossbeam_channel::Sender;
use serde_derive::Deserialize;
use crate::blocks::{Block, ConfigBlock, Update};
use crate::config::SharedConfig;
use crate::de::deserialize_duration;
@dijit
dijit / spam.log
Created June 10, 2021 13:36
Spammer
*** Joins: freecoupo (~freecoupo@reid-2r8.n4d.250.185.IP)
<freecoupo> Hello my friends! Claim up to US $24 in coupons now!
<freecoupo> Your $24 in coupons are here!
<freecoupo> https://a.aliexpress.com/_m0XtOXd Not spam, not virus, just coupons! ;)
<zeta> ‡
*** Quits: sync (~sync@reid-94vkcs.ga.comcast.net) (The TLS connection was non-properly terminated.)
*** Quits: freecoupo (~freecoupo@reid-2r8.n4d.250.185.IP) (G-lined: spam)
#include <stdio.h>
#include <stdlib.h>
int try_allocate(int i){
int *ptr;
ptr = (int*) malloc(i);
if (ptr==0) {
printf("FAILED TO ALLOCATE");
return 1;
}
~ » pg_dump -h ~/database -d junk -s
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 9.6.2
SET statement_timeout = 0;
SET lock_timeout = 0;
@dijit
dijit / show_refreshing_images.py
Created July 21, 2015 16:00
Sick to death of opening up `paint.exe` on windows server 2012 R2 because image viewer isn't installed and I'm using software that updates an on disk graph. So.. This..
#!/usr/bin/env python3
import tkinter
from PIL import Image
from PIL import ImageTk
from time import sleep
root = tkinter.Tk()
root.geometry('+%d+%d' % (100,100))
root.wm_title("Self Refreshing Image Viewer")
#Parallel Compression based on your number of cores.
function xzv() {
THREADS=`grep processor /proc/cpuinfo | wc -l`;
for file in $*; do
pv -s `stat -c%s $file` < $file | pxz -q -T $THREADS > $file.xz ;
done;
}
@dijit
dijit / get_ip_test.py
Created June 30, 2014 20:41
Testing some things I've never used before, mostly Qt, some argument parsing, copying to clipboard etc;
#!/usr/bin/python
# -*- coding: utf-8 -*-
""""
Author: Jan Harasym <jharasym@linux.com>
Website: dijit.sh
Creation Date: 30-06-2014
Last Modified: Mon 30 Jun 2014 21:40:53 BST
@dijit
dijit / drop_all_pg_seq.sh
Created March 11, 2014 15:43
Drop all sequences (pgsql)
for i in $( sudo -u postgres psql -q -t -d firebox\
-c "SELECT 'drop sequence ' || c.relname || ';' \
FROM pg_class c WHERE (c.relkind = 'S');" ); do
sudo -u postgres psql -d firebox -c "$i";
done
@dijit
dijit / keybase.io
Created February 19, 2014 17:18
keybase.io verify
### Keybase proof
I hereby claim:
* I am dijit on github.
* I am dijit (https://keybase.io/dijit) on keybase.
* I have the public key with fingerprint 908F&nbsp;BA22&nbsp;E6FB&nbsp;3E34&nbsp;F654&nbsp;&nbsp;1FCA&nbsp;A2B8&nbsp;1FFB&nbsp;8C94&nbsp;7F1B
To claim this, I am signing this object: