Skip to content

Instantly share code, notes, and snippets.

2019-09-26 12:40:23 - [sway/main.c:152] Linux void 5.2.17_1 #1 SMP PREEMPT Sat Sep 21 15:22:49 UTC 2019 x86_64 GNU/Linux
2019-09-26 12:40:23 - [sway/main.c:168] Contents of /etc/os-release:
2019-09-26 12:40:23 - [sway/main.c:152] NAME="void"
2019-09-26 12:40:23 - [sway/main.c:152] ID="void"
2019-09-26 12:40:23 - [sway/main.c:152] DISTRIB_ID="void"
2019-09-26 12:40:23 - [sway/main.c:152] PRETTY_NAME="void"
2019-09-26 12:40:23 - [sway/main.c:140] LD_LIBRARY_PATH=(null)
2019-09-26 12:40:23 - [sway/main.c:140] LD_PRELOAD=(null)
2019-09-26 12:40:23 - [sway/main.c:140] PATH=/home/k/.bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
2019-09-26 12:40:23 - [sway/main.c:140] SWAYSOCK=(null)
@KristupasSavickas
KristupasSavickas / hdd-temps.sh
Last active July 5, 2018 10:26
Shell script to print HDD temperatures (no root required!)
#!/bin/sh
# Dependencies:
# 1. qdbus
# sudo apt install qdbus
# 2. udisks2
# sudo apt install udisks2 && sudo systemctl start udisks2
#
# This could probably be rewritten to use dbus-send instead of qdbus.
@KristupasSavickas
KristupasSavickas / docker-compose.yml
Last active June 27, 2018 20:29
Media server/torrent box setup with docker
version: '3'
services:
qbittorrent:
image: linuxserver/qbittorrent
container_name: qbittorrent
restart: unless-stopped
environment:
- "PUID=1001" # uid of "qbittorrent"
- "PGID=1005" # gid of "torrents"
- "UMASK_SET=022" # rwxrwxr-x
#include "linked_list.h"
LinkedList::Node::Node(int value_) {
next = nullptr;
value = value_;
}
LinkedList::LinkedList() {
head_ = nullptr;
tail_ = nullptr;
@KristupasSavickas
KristupasSavickas / binaries.m
Last active September 28, 2017 20:28
Generates all n bit long binary numbers
clc; clear all;
function generate_binaries(n)
B = zeros(2^n, n);
for i = n:-1:1
st = 2 ^ (n - i);
for j = st:2 * st:2^n
for k = 1:st
B(j + k, i) = 1;
end
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Build (Makefile)",
"program": "${cwd}/bin/load_manager",
"args": [],
@KristupasSavickas
KristupasSavickas / RadixSortLinkedList.cs
Created May 30, 2017 16:01
Radix sort for a linked list in C#
static LinkedList<int> RadixSort(LinkedList<int> linkedList)
{
bool isFinished = false;
int digitPosition = 0;
var buckets = new List<Queue<int>>();
InitializeBuckets(buckets);
using System;
using System.Collections;
using System.IO;
using System.Text;
namespace Utilities.LinkedList
{
public class HDDLinkedList : IEnumerable, IDisposable
{
readonly FileStream stream;
namespace Uzduotis2
{
class BasketballPlayer : Player
{
public int Rebounds { get; private set; }
public int Assists { get; private set; }
public BasketballPlayer(string firstName, string lastName, int gameCount, int rebounds, int assists)
: base(firstName, lastName, gameCount)
{
require 'google/apis/youtube_v3'
require 'youtube-dl.rb'
api_key = "xxx"
youtube = Google::Apis::YoutubeV3::YouTubeService.new
youtube.key = api_key
videos = ["https://www.youtube.com/watch?v=G-Vg2YS-sFE",