Skip to content

Instantly share code, notes, and snippets.

Avatar

Petr Blaho petrblaho

View GitHub Profile
View tmm.sh
#!/bin/sh
if [ -z ${TMUX+x} ]
then
in_tmux="no"
else
in_tmux="yes"
fi
fzf_output=$(tmux list-sessions -F \#S 2> /dev/null | fzf --prompt Session: --print-query)
View gist:fc7b82f198fae9b8f5855adc38ad81d9
sudo dnf search *font* | grep -e 'noarch' | grep -v '^texlive' | awk -F. '{print $1}' | sort | uniq | xargs sudo dnf install -y
View gist:c1ace6d881b96f880679341cdbfff995
In [1]: from zonkylla.core.utils import iso2datetime
In [2]: from zonkylla.core.reports import upcoming_transactions
In [3]: trans = upcoming_transactions()
In [4]: filtered = [t for t in trans]
In [5]: filtered = [t for t in trans if t['payment_date'] == '2018-01-01']
View get_vms_ips.sh
virsh list | grep running | awk '{print $2}' | xargs -n1 -I{} sh -c "echo {}; virsh domifaddr {} --full | grep ip; echo '---'"
View openstack commands
❯ openstack --os-identity-api-version 3 --os-username cloud_admin --os-password password --os-domain-name admin_domain --os-user-domain-name admin_domain
(openstack) role assignment list --name
+------------------+------------------------------------+-------+---------------------+--------------+-----------+
| Role | User | Group | Project | Domain | Inherited |
+------------------+------------------------------------+-------+---------------------+--------------+-----------+
| admin | swift@Default | | service@Default | | False |
| _member_ | swift@Default | | service@Default | | False |
| admin | neutron@Default | | service@Default | | False |
| _member_ | neutron@Default | | service@Default | | False |
| admin | cind
View leafpic-logs
05-09 13:32:40.961 25056 25088 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
05-09 13:32:40.961 25056 25088 E AndroidRuntime: Process: com.horaapps.leafpic, PID: 25056
05-09 13:32:40.961 25056 25088 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:309)
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:242)
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
05-09 13:32:40.961 25056 25088 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
View testit.sh
#!/usr/bin/sh
studentdir=$1
declare -a commands=(
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiří"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiri"
"faketime 2015-10-13 bundle exec ruby kolikjeste.rb Renáta"
View test.html
<div class="reveal">
<div class="slides">
<section data-markdown>
<script type="text/template">
<http://slides.com>
```<b>Hello world</b>```
<u>test</u>
View testit.sh
#!/usr/bin/sh
studentdir=$1
declare -a commands=(
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiří"
"faketime 2015-10-10 bundle exec ruby kolikjeste.rb Jiri"
"faketime 2015-10-13 bundle exec ruby kolikjeste.rb Renáta"
View muni-ruby-testing.html
<section data-markdown>
# Proč testovat
* ověření funkčnosti
* automatizace
* ochrana před regresemi
* druh dokumentace
</section>
<section data-markdown>