Skip to content

Instantly share code, notes, and snippets.

@LeReverandNox
LeReverandNox / 99-citrix.rules
Created July 29, 2021 19:47
99-citrix.rules
SUBSYSTEM=="net",\
ACTION=="add",\
NAME=="Citrix_VA",\
RUN+="/usr/bin/systemd-resolve -i %k --set-dns=10.0.0.1 --set-domain=lectra.com --set-dnssec=off"
int recurse_n_queen(int **grid, int n, int col)
{
int row;
int i;
int j;
int as_cycle;
if (col >= n)
return 1;
row = (rand() % n);
@LeReverandNox
LeReverandNox / quick-look.sh
Created July 21, 2018 15:41
Poor's man quicklook
#!/bin/bash
function quick-look() {
SCREEN_WIDTH=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1)
SCREEN_HEIGHT=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2)
WIDTH=$(echo $(( ${SCREEN_WIDTH} * 0.75)) | cut -f1 -d".")
HEIGHT=$(echo $(( ${SCREEN_HEIGHT} * 0.75)) | cut -f1 -d".")
feh --title="feh_quicklook" --scale-down --geometry "${WIDTH}"x"${HEIGHT}" $1 $(pwd) >/dev/null 2>&1
}
#!/bin/bash
CURR_DESK_ID=$(chunkc tiling::query --desktop id)
if [ ! -f /tmp/chunkwm_fullscreen ]; then
touch /tmp/chunkwm_fullscreen;
chunkc set ${CURR_DESK_ID}_desktop_offset_top 0;
chunkc set ${CURR_DESK_ID}_desktop_offset_right 0;
chunkc set ${CURR_DESK_ID}_desktop_offset_bottom 0;
chunkc set ${CURR_DESK_ID}_desktop_offset_left 0;
chunkc core::unload border.so;
import sys
import math
from collections import namedtuple
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
# w: width of the building.
# h: height of the building.
w, h = [int(i) for i in input().split()]
from collections import namedtuple
Point = namedtuple('Point', ['y', 'x'])
class KTSolver(object):
def __init__(self, grid_size):
self._grid_size = grid_size
self._moves = []
self._grid = []
self._solutions = []
from colorama import Back, Style
class WordSearchSolver(object):
def __init__(self, grid = [], seeked_words = []):
self.grid = grid
self.seeked_words = seeked_words
self.found_words = []
self.highlighted_cells = set()
self.not_found_words = []
def count_up_to_50(n):
return [] if n > 50 else [n] + count_up_to_50(n + 1)
def sum_to(n):
return n if n == 1 else n + sum_to(n - 1)
def fibonacci(nb, prev_n = 0, next_n = 1):
return [next_n] if nb == 0 else [next_n] + fibonacci(nb - 1, next_n, prev_n + next_n)
def print_list(l):
def count_up_to_50(n):
return [] if n > 50 else [n] + count_up_to_50(n + 1)
def sum_to(n):
return n if n == 1 else n + sum_to(n - 1)
def fibonacci(nb, prev_n = 0, next_n = 1):
return [next_n] if nb == 0 else [next_n] + fibonacci(nb - 1, next_n, prev_n + next_n)
def print_list(l):
digits = {
1: "one",
2: "two",
3: "three",
4: "four",
5: "five",
6: "six",
7: "seven",
8: "eight",
9: "nine",