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 | |
set -e | |
set -o pipefail | |
trap 'echo ОШИБКА' ERR | |
# список пакетов в репах | |
# --disablerepo '*i686*' т.к. большинство пакетов есть и в 32, и в 64 битных вариантах | |
pkgs_list="$(dnf --disablerepo '*i686*' repoquery --qf '%{name} %{sourcerpm}' 2>/dev/null | sort -u)" | |
# кол-во пакетов в этом списке | |
pkgs_num="$(echo "$pkgs_list" | grep -c .)" |
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 python | |
a=100000 | |
s=12*1 | |
sum=a | |
for i in range(0, s): | |
sum=sum*(1+0.08/12) | |
print(sum-a) |
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 | |
# install: xdotool, binutils (strings), procps (pgrep), sed, grep | |
# usage: ./xdotool-sddm-login.sh <username> <password> | |
set -e | |
set -f | |
user="$1" | |
if [ -z "$user" ]; then |
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 <unistd.h> | |
#include <stdio.h> | |
int main(){ | |
for(;;){ | |
if (access("/tmp/xxx", F_OK) == 0) { | |
printf("%s", "File exists\n"); | |
break; | |
} else { | |
sleep(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
// gcc -g realm.c -o realm -lkrb5 | |
// HOST=XXX.LOC ./realm | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <krb5/krb5.h> | |
int main(){ | |
// nfs-utils/utils/gssd/krb5_util.c, find_keytab_entry() | |
krb5_error_code test; | |
krb5_context context; |
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 XDG_DATA_HOME | |
templatedir="/opt/kingsoft/wps-office/office6/asso_template" | |
if [ ! -d $templatedir ]; then | |
echo "asso_template not found" | |
exit 1 | |
fi | |
mimelist=(".pptx" ".ppt" ".pptm" ".pps" ".pot" ".potm" ".potx" ".ppsx" ".dps" ".dpsx" ".dpt" ".dptx" ".dpss" ".dpso" ".xlsx" ".xls" ".xlsm" ".xlt" ".xltm" ".xltx" ".et" ".etx" ".ett" ".ettx" ".ets" ".eto" ".docx" ".docm" ".doc" ".dot" ".dotm" ".dotx" ".wps" ".wpsx" ".wpss" ".wpso" ".wpt" ".wptx" ".rtf") |
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 | |
LIST="${LIST:-30 31 32}" | |
_gen(){ | |
set -e | |
trap 'echo ERROR $line' ERR | |
line="$1" | |
fc="$2" | |
suffix="$(echo "$line" | tr '.' '\n' | grep ^fc | tail -n1)" |
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
/* | |
* | |
* Info: amon.so | |
* Contact: mailto: <luca [at] lucaercoli.it> https://www.lucaercoli.it | |
* Version: 1.1 | |
* Author: Luca Ercoli | |
* | |
* | |
* 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 |
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
// gcc -lselinux st.c -o st.bin | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <selinux/selinux.h> | |
#include <selinux/get_context_list.h> | |
int main(){ | |
security_context_t *contextlist = NULL; | |
int rc = -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
#!/bin/sh | |
set -efu | |
export DEBIAN_FRONTEND=noninteractive | |
FALLBACK=0 | |
APT_MAIN=0 | |
DONE=0 | |
khpkg="" | |
kernel="$(uname -r || :)" | |
if [ -z "$kernel" ]; then | |
echo "Unable to get kernel version, trying fallback" |
NewerOlder