Skip to content

Instantly share code, notes, and snippets.

Stefan Wienert zealot128

Block or report user

Report or block zealot128

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zealot128
zealot128 / README.md
Last active Jun 21, 2018
Ruby: check for domain name certificate expirations (supports starttls smtp and tls/https)
View README.md

Check

check for domain tls certificate expirations.

Pass any number of domain:port pairs to the program, it will try to fetch all and present a little table with the soonest to expire on top.

On port 25 it will use Starttls for validation, otherwise SNI TLS.

ruby check.rb my.domain.de www.domain.de mail.domain.de:25 pop.domain.de:995
@zealot128
zealot128 / vimrc.vim
Last active Jun 19, 2018
VIM replace ruby 1.9 Hash literals to 2+
View vimrc.vim
command! ReplaceRuby19Hash :%s/:\([a-z_]\+\) *=> */\1: /
@zealot128
zealot128 / rails_5.2-fixes.md
Last active Jun 4, 2018
Rails 5.2. be_success -> be_successful
View rails_5.2-fixes.md

Rails 5.2. be_success -> be_successful

using ag or fgrep

sed -i 's/be_success$/be_successful/g' `ag be_success$ spec -l`

image_tag resolver

@zealot128
zealot128 / README.md
Created Jun 2, 2018
Strava personal heatmap
View README.md
@zealot128
zealot128 / fix.sh
Created Apr 3, 2018
Fix out of space problem after unattended upgrades clogged up boot with linux kernel images
View fix.sh
sudo apt-get autoremove;sudo apt-get autoclean;sudo apt-get clean
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
sudo apt-get update && sudo apt-get upgrade
# source: https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/1357093/comments/111
@zealot128
zealot128 / README.md
Created Oct 8, 2017
ffmpeg cut of from start and back - ruby convert script
View README.md

Cut of from start/back of file

Useful for postprocessing various youtube videos with jingles/ad "follow us" stuff at the end.

ffmpeg has an easy way to cut off from beginning, but not to say "cut of 20s from the end". So one has to use to do arithmetics with duration. Here, using ruby script.

USAGE

@zealot128
zealot128 / ldap.sh
Created Jul 14, 2017
Change LDAP/Samba account information from command line
View ldap.sh
# Use ldapmodify and copy carefully
# 1. Unblock user - set expiration to never:
$ ldapmodify -H 'ldaps://pdc.mycompany.com:636' -D 'cn=Administrator,cn=Users,dc=pdc,dc=pludoni,dc=com' -x -W
Enter LDAP Password:
dn: CN=Firstname Lastname,CN=Users,DC=pdc,DC=pludoni,DC=com
changetype: modify
replace: accountExpires
accountExpires: 9223372036854775807
<Ctrl+D>
@zealot128
zealot128 / filter.js
Created May 9, 2017
Vue2 filter thousand seperator / rounded (german comma)
View filter.js
Vue.filter('formatNumber', function (value) {
const rounded = Math.round(value * 100) / 100
return rounded.toString().replace('.', ',').replace(/\B(?=(\d{3})+(?!\d))/g, ".");
});
View run.rb
# RAILS_ENV=production bundle exec rails r run.rb
puts "All Time:"
puts "-------------------"
puts "Number of successful deploys into production:"
puts Ci::Pipeline.where(ref: 'master').where(status: 'success').count
puts "Number of commits over all projects (no forks)"
puts Project.all.reject{|p| p.forked? }.map{|i| i.statistics.commit_count }.sum
puts "Number of issues"
@zealot128
zealot128 / crontab.cron
Created Oct 18, 2016
Omnibus Gitlab backup cronjob
View crontab.cron
# Crontab
# once per week backup, move to "/backup" gzip it, delete everything but the latest 5 files
0 4 * * 1 /opt/gitlab/bin/gitlab-ci-rake gitlab:backup:create CRON=1 && mv /var/opt/gitlab/backups/* /backup/ && cd /backup && gzip *.tar && rm `ls -t | awk 'NR>5'`
You can’t perform that action at this time.