Skip to content

Instantly share code, notes, and snippets.

@Trucido
Trucido / foo.sh
Created April 7, 2018 19:01
PROMPT_COMMAND
if [ -z "$PROMPT_COMMAND" ]; then
case $TERM in
xterm*|vte*)
# check /etc/sysconfig and /etc/default for expert custom file first
# Debian example: 'echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
elif [ -e /etc/default/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/default/bash-prompt-xterm
elif [[ -e "${XDG_CONFIG_HOME:-$HOME/.config}/bash-prompt-xterm" ]]; then
@Trucido
Trucido / uniquefy.sh
Created April 8, 2018 20:50
uniquefy_buttpaths
uniquefy_search_path ()
{
OIFS="$IFS"
IFS='
'
set -- $(echo ${1+"$@"} | sed -r 's@/*:|([^\\]):@\1\n@g;H;x;s@/\n@\n@')
IFS="$OIFS"
_y=""
for _x ; do
--- 1/etc/profile.d/vte.sh 2018-04-19 16:46:08.000000000 -0400
+++ 2/etc/profile.d/vte.sh 2018-05-17 15:08:01.808845123 -0400
@@ -50,9 +50,11 @@
}
__vte_prompt_command() {
+ local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
+ command="${command//;/ }"
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
################################################################################
## ~/.inputrc
##
## Control the behaviour of the readline library used e.g.
## by the bash in the interactive mode for line editing.
##
################################################################################
##----------------------------------------------------------------------------##
## readline(3) - Global order: /etc/inputrc, ${INPUTRC:-$HOME/.inputrc}
--- 1/usr/share/vim/site/plugin/powerline.vim 2018-05-19 13:09:49.950986016 -0400
+++ 2/usr/share/vim/site/plugin/powerline.vim 2018-05-19 13:10:13.602985689 -0400
@@ -26,14 +26,14 @@ if exists('g:powerline_pycmd')
let s:pyeval = g:powerline_pyeval
let s:has_python = 1
endif
-elseif has('python')
- let s:has_python = 1
- let s:pycmd = 'py'
- let s:pyeval = get(g:, 'powerline_pyeval', 'pyeval')
#!/bin/bash
#
# /etc/init.d/zswap || zswap.service || /usr/local/sbin/zswap || somethingsomething
#
# License: copyleft, copyup, copydown, copyright, do whatever the fuck you want.
### BEGIN INIT INFO
# Provides: zswap
# Required-Start:
# Required-Stop:
#!/bin/sh
# -*- mode:shell-script sh-basic-offset:4 indent-tabs-mode:nil -*-
########################################################################################################################
# zswap.sh - Activate and tune Zswap compressed cache for swap pages.
#
# Enables/Renables/tunes zswap without the need for initramfs/dracut/modprobe/modules-load hackery.
#
# Author : <REDACTED>
# Copyright: 2018 <REDACTED> <########@####.com>
#
@Trucido
Trucido / linux_os_detection_from_facter.include.spec
Last active June 28, 2018 14:07
rpm spec macros to do linux detection
%ifos Linux
%define is_suse_family %((test -e /etc/SUSE-brand || test -e /etc/SuSE-release) && echo 1 || echo 0)
%define is_sle_family %(grep -qi 'SUSE LINUX Enterprise' /etc/SuSE-release && echo 1 || echo 0)
%define is_sles %(grep -qi 'SUSE LINUX Enterprise Server' /etc/SuSE-release && echo 1 || echo 0)
%define is_sled %(grep -qi 'SUSE LINUX Enterprise Desktop' /etc/SuSE-release && echo 1 || echo 0)
%define is_opensuse %((grep -qi 'openSUSE' /etc/SUSE-brand || grep -qi 'openSuSE' /etc/SuSE-release) && echo 1 || echo 0)
%define is_redhat_family %(test -e /etc/redhat-release && echo 1 || echo 0)
# refer to http://fedoraproject.org/wiki/Packaging:DistTag
%define is_rhel %(grep -qi 'Red Hat Enterprise Linux Server' /etc/redhat-release && echo 1 || echo 0)
diff -uNr freetype-2.9.orig/include/freetype/config/ftoption.h freetype-2.9/include/freetype/config/ftoption.h
--- freetype-2.9.orig/include/freetype/config/ftoption.h 2018-05-02 00:28:16.964364890 -0400
+++ freetype-2.9/include/freetype/config/ftoption.h 2018-05-02 00:29:51.040464644 -0400
@@ -118,7 +118,7 @@
/* rendering technology that produces excellent output without LCD */
/* filtering. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
# /etc/profile.d/freetype2.sh
# FreeType configuration file
# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
# version. FreeType must be compiled with 'FT_CONFIG_OPTION_SUBPIXEL_HINTING',
# otherwise these options are not available for configuration during runtime.
# Currently, three versions are available:
#
# truetype:interpreter-version=35 # Classic mode (default in 2.6)
# truetype:interpreter-version=38 # Infinality mode