Skip to content

Instantly share code, notes, and snippets.

View fcicq's full-sized avatar

fcicq fcicq

View GitHub Profile
@fcicq
fcicq / wget-cleanup.sh
Created January 14, 2019 11:36
wget-cleanup.sh (bash only).
#!/bin/bash
rm ~/index.html.* 2>/dev/null || :
rm ~/index.html 2>/dev/null || :
shopt -s nullglob
for f in ~/wget-log.* ~/wget-log; do
(tail $f | fgrep "100%" >/dev/null) && (rm -v $f)
done
[ ! -f ~/wget-log ] && touch ~/wget-log
cat <<EOF >/etc/systemd/network/80-dhcp.network
[Match]
Name=en* eth*
[Network]
DHCP=yes
IPv6PrivacyExtensions=true
EOF
systemctl enable systemd-networkd
@fcicq
fcicq / sed-patch.sh
Last active December 29, 2018 12:51
sed-patch.sh (sed-commands) file. Note: only works on one file at a time!
f=${@:$#}; diff -u $f <(sed $@) -L a/$f -L b/$f
@fcicq
fcicq / nginx-ods.conf
Created December 5, 2018 23:10
ODSAgent by nginx
error_log stderr crit;
pid /dev/null;
master_process off;
daemon off;
events{}
http{
access_log /dev/stdout;
proxy_temp_path /dev/shm/proxy;
fastcgi_temp_path /dev/shm/fcgi;
uwsgi_temp_path /dev/shm/uwsgi;
@fcicq
fcicq / shmem-xattr.patch
Created December 1, 2018 23:28
shmem: enable user xattr for tmpfs, for android-x86, original from https://www.spinics.net/lists/linux-mm/msg109775.html
diff --git a/mm/shmem.c b/mm/shmem.c
index 446942677cd4..ba6ddaa4f862 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3157,6 +3157,12 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler,
return simple_xattr_set(&info->xattrs, name, value, size, flags);
}
+static const struct xattr_handler shmem_user_xattr_handler = {
+ .prefix = XATTR_USER_PREFIX,
@fcicq
fcicq / vmlinux-llvm-lld.patch
Created October 23, 2018 05:48
fix ld.lld: error: ./arch/x86/kernel/vmlinux.lds:342: at least one side of the expression must be absolute
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index f05f00acac89..7fe2ee55c713 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -364,7 +364,7 @@ SECTIONS
* Per-cpu symbols which need to be offset from __per_cpu_load
* for the boot processor.
*/
-#define INIT_PER_CPU(x) init_per_cpu__##x = x + __per_cpu_load
+#define INIT_PER_CPU(x) init_per_cpu__##x = ABSOLUTE(x) + __per_cpu_load
From: Brian Maly <brian.maly@oracle.com>
Date: Wed, 20 Dec 2017 04:58:08 +0000 (-0500)
Subject: x86: add support for crashkernel=auto
X-Git-Tag: v4.14.14-11~1221
X-Git-Url: http://oss.oracle.com/git/gitweb.cgi?p=linux-uek5.git;a=commitdiff_plain;h=f03174698ead1617281e7cb0b56b937731ce1790;hp=ef29b7a9e060d1034edf0b8584d5231ca96847e9
x86: add support for crashkernel=auto
This patch adds support for "crashkernel=auto" and was backported from RHEL7.
#!/bin/bash
u=$1
if [ ! -n "$2" ]; then
f=$(basename "$1")
shift
else
f=$2
shift
shift
fi
diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h
index 709a574..92e41cb 100644
--- a/arch/arm64/include/asm/syscall.h
+++ b/arch/arm64/include/asm/syscall.h
@@ -20,7 +20,9 @@
#include <linux/compat.h>
#include <linux/err.h>
-extern const void *sys_call_table[];
+typedef void (*sys_call_ptr_t)(void);
#!/bin/sh
[ $# -eq 0 ] && { echo "# no args"; exit; }
for f in "$@"; do
[ ! -f $f ] && { echo "# $f not file"; }
echo "### restoring $(basename $f)"
echo fi="$f"
echo "mkdir -p \$(dirname \$fi)"
echo \[ ! -f \$fi \] \&\& cat \<\<\'EOF\' \> \$fi
cat $f
echo EOF