Skip to content

Instantly share code, notes, and snippets.

@daniel-j
daniel-j / pulse.log
Last active December 30, 2015 17:48
pulseaudio no outputs - MacBook Air 6,1 with pulseaudio 4.0-328
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
D: [pulseaudio] core-util.c: RealtimeKit worked.
I: [pulseaudio] core-util.c: Successfully gained nice level -11.
I: [pulseaudio] main.c: This is PulseAudio 4.0-328-g9833b
D: [pulseaudio] main.c: Compilation host: x86_64-unknown-linux-gnu
D: [pulseaudio] main.c: Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -Wextra -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option
D: [pulseaudio] main
@daniel-j
daniel-j / wallpaper-changer
Last active July 26, 2022 08:07
This is a simple random wallpaper changer to use with Awesome WM. You need to install feh to use this.
#!/bin/bash
#
# Created by djazz // Dangershy
# Dependencies: feh
#
FOLDER="~/Pictures/wallpapers"
DELAY=10
# to make it loop over lines instead of spaces in filenames

Grund:

  • Inte Ubuntu Unity eller GNOME Shell
  • Linux Mint XFCE
  • Manjaro (XFCE)
  • Xubuntu (XFCE)
  • Lubuntu (LXDE)
  • Debian

Skrivbordsmiljöer (väljs vid login)

@daniel-j
daniel-j / automatic.js
Last active December 22, 2015 23:39
dbwebb grill ht13 solver
#!/usr/bin/env node
// By djazz
// http://djazz.mine.nu
var net = require('net');
var cmd = new Buffer(new Buffer("げ啖䕉卒ㅔ兂噒獉啒儱䙖杫䙒偊䙕䙂楕䡸噒村こ婖䙌呖卒䱂噒杫ご朴け偸さ啖䕌䙤䍖佂啑䈱噕䉖䙌呖卒佂啑䈱噕䉖䕉伹䕉圹啒猴噖䙎䕉䈵啔剆啖杅ご朴歑倹䕖獧ㅔ䙂楔呂啑䙚䕌䙤䍖兂噑䙂汕獍啓吵噒啊䕉佬䕖朸歑倹祓兂噑䙂汕獍げ啖䙉䉒歑䙸䕌卒ㅔ杁啑䵸䙉䉒歑䙸祕䙸䕗啬䙉䙰歕㴸" , "ucs2").toString(), "base64").toString().split(",");
var client = net.connect(2323, "dbwebb.se", function () {
@daniel-j
daniel-j / spotify.js
Last active January 6, 2024 04:19
A simple node.js program to listen to Spotify tracks, albums and playlists
#!/usr/bin/env node
'use strict';
/*
This is a simple Spotify cli-based client with optional Icecast2/shout support!
It should work for non-premium users, but you must connect your Spotify account to Facebook.
Usage:
$ node spotify <spotify uris> <playlist uri> <album uri> <track uri> <etc...>
@daniel-j
daniel-j / gist:4718705
Created February 5, 2013 23:29
Heap.h
#ifndef HEAP_H
#define HEAP_H
#include <iostream>
using namespace std;
template <typename T>
class Heap {
private:
@daniel-j
daniel-j / gist:4711506
Created February 5, 2013 02:02
SGIP BOT
'use strict';
var net = require('net');
var dgram = require('dgram');
var sqlite3 = require('sqlite3').verbose();
function openDb () {
var db = new sqlite3.Database('bot.sqlite', function (err) {
if (err) {
console.log("Error opening database", err);
}
@daniel-j
daniel-j / gist:3841983
Created October 5, 2012 19:53
Node.js LAN port scanner
var net = require('net');
var dns = require('dns');
var startAddress = "194.47.158.";
var scanAddress = "194.47.158.252";
var scanPort = 5357;
scanByPort(startAddress, scanPort, function (scanlist) {
console.log(startAddress+"*: [ "+scanlist.join(", ")+" ]");
@daniel-j
daniel-j / gist:3829127
Created October 3, 2012 19:14
Yatzy by djazz
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
#include <fstream>
using namespace std;
const int DICE_COUNT = 5;
const int ROUND_COUNT = 6;
var leftleggeo = new THREE.CubeGeometry(4, 12, 4);
var leftleg = new THREE.Mesh(leftleggeo, new THREE.MeshFaceMaterial());
leftleg.position.z = -2;
leftleg.position.y = -6;
scene.add(leftleg);