Skip to content

Instantly share code, notes, and snippets.

View BlackMaria's full-sized avatar
💭
hating social media and public status indicators

Hroðgar Skjöldung BlackMaria

💭
hating social media and public status indicators
  • 3rd planet left of the yellow one
View GitHub Profile
@BlackMaria
BlackMaria / diff.diff
Created March 25, 2019 16:55
1080p mod for x230 requires some tweaks in heads
diff -uNr linux-4.1.3-vanilla/drivers/gpu/drm/i915/intel_dp.c linux-4.1.3/drivers/gpu/drm/i915/intel_dp.c
--- linux-4.1.3-vanilla/drivers/gpu/drm/i915/intel_dp.c 2015-07-21 18:10:33.000000000 +0100
+++ linux-4.1.3/drivers/gpu/drm/i915/intel_dp.c 2015-08-02 11:11:37.305576415 +0100
@@ -102,8 +102,7 @@
static bool is_edp(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-
- return intel_dig_port->base.type == INTEL_OUTPUT_EDP;
+ return intel_dig_port->base.type == INTEL_OUTPUT_EDP || strncmp(intel_dp->attached_connector->base.name, "DP-3", 4) == 0;
@BlackMaria
BlackMaria / install_beats.sh
Last active February 13, 2019 15:56
notes on how i installed my beats on my home network. I should make an ansible module for that
#!/bin/bash
VERSION=6.3.0
ELK_HOST=10.1.202.107
ROOT=${PWD}
BEATS_ROOT=/opt/beats
mkdir -p ${BEATS_ROOT} BEATS
cd BEATS
#!/bin/bash
# source for doc http://wurstmeister.github.io/kafka-docker/
#
# I personally suggest you create all of these containers, but for simplicity I show you how to use them by the author
#
YOUR_IP=192.168.1.2
git clone https://github.com/wurstmeister/kafka-docker
cat <<EOF >> ~/.ssh/config
Host docker
Hostname 192.168.99.100
User docker
IdentityFile ~/.docker/machine/machines/default/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
EOF

OTR Fingerprint

95A3A7B0 84AB7912 6ABBE4B9 1BD791D6 BDBA3CCA.

#!/bin/bash
dir=elk
mkdir -p ${dir}/conf ${dir}/logs/
cd ${dir}
cat <<EOF> docker-compose.yml
elk:
image: sebp/elk
ports:
@BlackMaria
BlackMaria / m.py
Last active August 25, 2016 18:25
def regex_params(data,search,replace):
tmp = {}
for i in data:
if re.search(search, i):
fixed = re.sub(search, replace, i)
tmp[fixed] = data[i]
for i in tmp:
if re.search(replace, i):
fixed = re.sub(replace, search, i)
data[i] = tmp[i]
EPOCH=$(shell date +%s )
NAME=application
build:
docker build -t ${NAME}:${EPOCH} .
@docker rmi ${NAME}:latest >& /dev/null || echo ${NAME}:latest created
docker tag ${NAME}:${EPOCH} ${NAME}:latest
export:
docker save ${NAME}:latest > ${NAME}:latest.tgz

The Issue

  1. When attempting to create a stack, if the connection gets cut (or the user cancels the command inflight), some requests to AWS may have succeeded after the command ceased writing to the log.

  2. Upon the next run of the command, terraform will fail because the "names" of the "resource" will have already been created.

  • This requires the manual removal of those "resources"

The fix? -- Suggestions

  1. Before sending a request to AWS, save what is about to be requested.
#!/bin/bash
#
# Issue:
# if you want to mount a directory in docker-kitematic that is not inside the /Users dir
# you need to add the share and mount it on the docker host OS
# Avoide non AlphaNumeric characters here
MOUNT_NAME="testDir"
DIR=/test