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 <sys/types.h> | |
#include <grp.h> | |
#include <pwd.h> | |
#include <nss.h> | |
#include <stdio.h> | |
/* Possibly a memory leak according to documentation */ | |
#define SETUP_DB(db, service) if (service != NULL) { __nss_configure_lookup(db, service); } | |
void print_passwd(struct passwd *entry) { |
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/env bash | |
# vim: set number tabstop=4 shiftwidth=4 smarttab expandtab: | |
_transform_slaves() { | |
xargs -n1 -I{} realpath "/sys/block/{}/../../" | sort -u | tr '\n' ',' | |
} | |
iterate_dms() { | |
local dmname dmuuid dmslaves dmslavescnt |
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/env bash | |
# BEGIN: PCIe-related things | |
_read_attr() { | |
local dir="$1" name="$2" | |
local path=$(printf "%s/%s" "$dir" "$name") | |
cat "$path" | |
} |
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/env bash | |
function cat_passwd_column() { | |
awk -F: '{ print $2; }' | |
} | |
function cat_passwd_salt() { | |
awk -F'$' '{ print $3; }' | |
} |
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/env bash | |
_calc() { awk "BEGIN{print $*}"; } | |
_call_lspci() { | |
local pcie="$1" | |
lspci -s "$pcie" -vvv | |
} |
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
from libc.stdlib cimport malloc, free | |
from libc.stdio cimport * | |
from posix.unistd cimport * | |
from posix.stdlib cimport * | |
from posix.fcntl cimport * | |
def test_cython(path): | |
cdef int ret | |
cdef int stdout_save, dev_null | |
cdef int O_DIRECT = 040000 |
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
# Maintainer: Josip Ponjavic <josipponjavic at gmail dot com> | |
# Contributor: | |
pkgname=marker-git | |
pkgver=2018.03.09.r86.g2d701156 | |
pkgrel=1 | |
pkgdesc='Markdown editor for linux made with Gtk+-3.0' | |
arch=('x86_64') | |
url='https://github.com/fabiocolacio/Marker' | |
license=('GPL3') |
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
# | |
# http://perldoc.perl.org/CORE.html#OVERRIDING-CORE-FUNCTIONS | |
# > To override a built-in globally (that is, in all namespaces), you need to | |
# > import your function into the CORE::GLOBAL pseudo-namespace at compile | |
# > time: | |
# > | |
# > BEGIN { | |
# > *CORE::GLOBAL::hex = sub { | |
# > # ... your code here | |
# > }; |
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/python | |
from sys import argv | |
from os import listdir, symlink, unlink | |
from os.path import isfile, join, getctime | |
from fnmatch import fnmatch | |
from datetime import datetime, date | |
from subprocess import run, Popen, PIPE | |
from ftpush import ftpush | |
from parse_db import DBReader |
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/python | |
import tarfile | |
from sys import argv | |
from os.path import dirname, basename | |
class TarFileWithDirs(tarfile.TarFile): | |
def __init__(self, *args, **kwargs): | |
super(TarFileWithDirs, self).__init__(*args, **kwargs) | |
self._dirs = {} | |
for o in self: |
NewerOlder