Skip to content

Instantly share code, notes, and snippets.

@leberblock
leberblock / lsof-deleted
Last active May 16, 2024 17:02
A process does not release deleted filespace.
lsof | grep '(deleted)'
# stop/kill corresponding service
@leberblock
leberblock / modprobe.conf
Created March 25, 2024 16:17
workaround fixing linux soundproblems with lenovo yoga c930
## /etc/modprobe.d/modprobe.conf
options snd_intel_dspcfg dsp_driver=2
## init 6
@leberblock
leberblock / aliases
Last active March 22, 2024 08:28
os - create global aliases
-> where to place?
/etc/profile.d/aliases.sh
-> ansible example
- name: Ensure aliases are present in /etc/profile.d/aliases.sh
lineinfile:
path: /etc/profile.d/aliases.sh
line: "{{ item }}"
loop:
- "alias sudi='sudo -i'"
@leberblock
leberblock / install docker and docker compose on centos7
Created February 11, 2020 13:16
install docker and docker-compose on centos7
## install docker
yum check-update
curl -fsSL https://get.docker.com/ | sh
systemctl start docker
systemctl status docker
systemctl enable docker
-> docker with non-root user
usermod -aG docker $(whoami)
@leberblock
leberblock / tastatur: falls obere zahlenreihe mal nicht funktionieren sollte
Created January 14, 2020 14:14
tastatur: falls obere zahlenreihe nicht funktionieren sollte
[Strg]+[Win]+[Alt] für ca. 5-10 Sekunden gedrückt halten. (bei Notebooks [Strg]+[Alt]+[Fn])
Das hat offenbar bei einigen Leuten gut funktioniert :)
siehe auch hier:
https://social.technet.microsoft.com/Forums/office/en-US/2f965e8a-d9d3-4c80-b0d7-c6560999ee4c/only-numerics-key-5-and-6-work-and-keyboard?forum=w7itprohardware
@leberblock
leberblock / git: set global user
Created December 16, 2019 16:24
git: set global user
git config --global user.email "email@example.com"
@leberblock
leberblock / shell: date command identify last 3 previous months
Created September 17, 2019 14:02
shell: date command identify last 3 previous months
#!/bin/bash
set -x
echo "[$(date "+%Y-%m-%d %H:%M:%S")] started ..."
# set date
month=$(date +"%-m")
month_prev=$((month - 3))
month_end=$month
month_start=$(date -d "$(date +%Y-%m-1) -3 month" +%-m)
@leberblock
leberblock / powerline: installation centos7 + activation in vim and bash
Last active August 10, 2020 11:53
powerline: installation centos7 + activation in vim and bash
### installation centos7
sudo yum install python-pip
pip install --user powerline-status
### vim
set rtp+=$HOME/.local/lib/python2.7/site-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
@leberblock
leberblock / bash: copy files with excluding directory
Created April 12, 2017 12:37
bash: copy files with excluding directory
rsync -av --exclude='jobs' /var/kvtg/jenkins/ /var/tmp/jenkins/
@leberblock
leberblock / gist:c4e7f0522f9c526adcd58b3df2625abe
Last active May 23, 2019 09:34
bash: extend harddisk space with RHEL7 and lvm
yum install system-storage-manager
ssm list
ssm add -p <poolname> <device>
ssm add -p centos /dev/sdb
ssm list
df -h