Skip to content

Instantly share code, notes, and snippets.

set speller "aspell -c"
set morespace
set nowrap
set softwrap
unset tempfile
set tabsize 2
set tabstospaces
#set mouse
set smarthome
set suspend
#find which mem chip exactly it is (in flashrom's internal naming scheme - the real chip is the 6406E, but flashrom combines it with the 6408E)
flashrom -L | grep MX25L
#read
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip MX25L6406E/MX25L6408E -r romread1.rom
#read a few times and compare with 'diff' to be sure read didn't have errors, just in case you have to flash back
[Unit]
Description="Script actions description"
JobTimeoutSec=60
AssertPathExists=/path/to
[Service]
Type=simple #forking
ExecStart=/bin/bash /path/to/script.sh
Nice=0
http://stackoverflow.com/questions/15291500/i-have-2-versions-of-python-installed-but-cmake-is-using-older-version-how-do
EITHER:
find_package( PythonLibs 2.7 REQUIRED ) # if it already has a find_package(PythonLibs)
OR:
needed to use python2.7 to compile an older library, but cmake keeps picking up my python3.2 libraries (and executable).
First, I ran cmake with default options, then edited the CMakeCache.txt file which it generated. I did it this way primarily because I didn't know the proper -D... incantations to cause cmake to get the python library and include paths, etc right in the first place.
In my CmakeCache.txt, I found lines like this
@Waltibaba
Waltibaba / systemd graphical program
Created February 14, 2017 16:04
systemd graphical script/prog
[Unit]
Description="graphical application"
JobTimeoutSec=60
AssertPathExists=/home/USERNAME
[Service]
WorkingDirectory=/home/USERNAME
Environment=XAUTHORITY=/home/USERNAME/.Xauthority
Environment=DISPLAY=:0
Type=forking
@Waltibaba
Waltibaba / coreboot_config_t420_2017_02
Created May 23, 2017 11:15
coreboot build configuration for t420, applicable to master branch around february 2017. Requires VGA and nvramcui binaries
#
# Automatically generated file; DO NOT EDIT.
# coreboot configuration
#
#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_CBFS_PREFIX="fallback"
enable it:
/etc/pulse/default.pa
=========
### Enable Echo/Noise-Cancelation
load-module module-echo-cancel source_name=echoCancel_source sink_name=echoCancel_sink aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1"
set-default-source echoCancel_source
set-default-sink echoCancel_sink
stop the echoey crackling (https://bbs.archlinux.org/viewtopic.php?id=116172) uncomment/edit these lines:
@Waltibaba
Waltibaba / pacman-upgrade-hooks
Last active April 15, 2019 10:19
/etc/pacman.d/hooks/. - pacman hooks for not killing the system when there's a kernel update.
/etc/pacman.d/hooks/backup-modules.hook
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
@Waltibaba
Waltibaba / 10-tpm.sh
Created November 13, 2019 21:27
suspend hook for tpm issues on kernel 5.1+
#!/bin/bash
# put this in /usr/lib/systemd/system-sleep/
# don't forget to chmod +x it
case $1/$2 in
pre/*)
# echo "Going to $2..."
/usr/bin/rmmod tpm
/usr/bin/rmmod tpm_tis
/usr/bin/rmmod tpm_tis_core
#!/bin/bash
echo "testing for sudo"
sudo date
if [ $? -ne 0 ]
then
echo "failed sudo"
return -1
fi