This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
unset LC_MESSAGES | |
unset LC_CTYPE | |
export LC_ALL=C | |
export LANG=C | |
match_suffix() | |
{ | |
[[ "$1" =~ (\.[A-Za-z~][A-Za-z0-9~]*)*$ ]] && printf -- "%s" "${BASH_REMATCH[0]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import math | |
item_min = 57 | |
item_max = 225 | |
num_simulation = 100000 | |
cost = 60000 | |
def draw(sm): | |
global s, item_min, item_max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Cost of Reinforcement Simulator</title> | |
<style> | |
table, th, td { | |
border: 1px solid white; | |
border-collapse: collapse; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
close(fd) of a device file descriptor after making a change and wait for any udev change event | |
if none is received, trigger the change by writing change to the uevent file in /sys | |
Without udev watch rule: | |
$ sudo ./udev_device_wait_change | |
Issued 'change' uevent via '/sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/uevent' | |
Change event seen! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from systemd import journal | |
import random | |
import sys | |
import time | |
import string | |
from syslog import syslog | |
class ToLog: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
readonly TMPDIR="$(mktemp -d -t checkrpmset.XXXXXX)" | |
trap ' | |
ret=$?; | |
[[ $TMPDIR ]] && rm -rf -- "$TMPDIR"; | |
exit $ret; | |
' EXIT | |
rpms=( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Harald Hoyer <harald@redhat.com> | |
# Copyright 2015 Red Hat, Inc. All rights reserved. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### modified repoquery.py for graphviz .dot generation | |
# replace /usr/lib/python3.5/site-packages/dnf-plugins/repoquery.py | |
# | |
# example: | |
# $ dnf -q --disablerepo=* --enablerepo=rawhide repoquery \ | |
# --arch=noarch,x86_64 --requires --recursive bash systemd kernel dracut bash | |
# | |
# | |
# Copyright (C) 2014 Red Hat, Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Usage: | |
# $ python3 prereq.py repodata-primary.xml.gz | |
# | |
import sys | |
import xml.etree.ElementTree as ET | |
import gzip | |
document = ET.parse(gzip.open(sys.argv[1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <net/if.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
char ifname[IF_NAMESIZE+1]; | |
int ifindex = atoi(argv[1]); | |
if (if_indextoname( ifindex, ifname) != NULL) | |
puts(ifname); |
OlderNewer