street.yogahttps://street.yoga/2022-07-18T00:00:00+02:00Yoga & MachinesGenerator Expressions and List Comprehensions2022-07-18T00:00:00+02:002022-07-18T00:00:00+02:00streetyogitag:street.yoga,2022-07-18:/generator-expressions.html<p>Explicit is better than implicit, I know, but where is the fun in that :)</p><p>I can't help myself, but I feel pretty comfortable with generator expressions and comprehensions, so much that I always prefer them over for loops.</p>
<p>Take this examples:</p>
<p>Calculate the future value of your savings account:<br>
Today 100$<br>
Year after 10$<br>
Year after 20$<br>
Year after 50$ <br>
Year after 30$<br>
Year after 25$ </p>
<p>Whats the value after 5 years with an interest rate of 3% p.a.? </p>
<div class="highlight"><pre><span></span><code><span class="n">cf</span> <span class="o">=</span> <span class="p">[</span><span class="mi">100</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">25</span><span class="p">]</span>
<span class="n">n</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">6</span><span class="p">)[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">f</span> <span class="o">=</span> <span class="mf">1.03</span>
<span class="nb">sum</span><span class="p">(</span><span class="n">cf</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">*</span> <span class="n">f</span><span class="o">**</span><span class="n">n</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">n</span><span class="p">)</span>
<span class="c1"># Or without n</span>
<span class="nb">sum</span><span class="p">(</span><span class="n">cf</span><span class="p">[</span><span class="o">-</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="n">f</span><span class="o">**</span><span class="n">i</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">6</span><span class="p">))</span>
</code></pre></div>
<p>Another example: </p>
<p>Payout plan:<br>
50$ Year one<br>
60$ Year two<br>
70$ Year three<br>
80$ Year four<br>
100$ Year five </p>
<p>Calculate and print funding amount to pay today with an interest rate of 4%</p>
<div class="highlight"><pre><span></span><code><span class="n">cf</span> <span class="o">=</span> <span class="p">[</span><span class="mi">50</span><span class="p">,</span> <span class="mi">60</span><span class="p">,</span> <span class="mi">70</span><span class="p">,</span> <span class="mi">80</span><span class="p">,</span> <span class="mi">100</span><span class="p">]</span>
<span class="n">f</span> <span class="o">=</span> <span class="mf">1.04</span>
<span class="n">PV</span> <span class="o">=</span> <span class="p">[</span><span class="nb">print</span><span class="p">(</span><span class="n">cf</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">/</span> <span class="n">f</span><span class="o">**</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">))</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">)]</span>
</code></pre></div>From Jekyl to Pelican2022-07-14T00:00:00+02:002022-07-14T00:00:00+02:00streetyogitag:street.yoga,2022-07-14:/byebye-ruby-hello-python.html<p>Some Python a day, keeps the Doctor away</p><p>A total revamp of my moddest homepage. I'm going from the github pages provided Jekyll static site generator to <a href="https://github.com/getpelican/pelican">Pelican</a>.<br>
It is a lot of work, as I have to change metadata and formating of ancient articles I wrote over the years and decided to bring back.<br>
Those date back to <a href="https://blogger.com">blogger</a>, <a href="https://wordpress.com">wordpress</a>, and even a short time of hosting at a former company I worked for. It didn't last forever but was free :) <br>
Now I can use my Python skills to extend the blog, before it was Ruby, which I also liked but don't have the time anymore to learn both. </p>Python on Static Websites2022-06-24T00:00:00+02:002022-06-24T00:00:00+02:00streetyogitag:street.yoga,2022-06-24:/matplotlib-twin-axes.html<p>Howto create beautiful plots with pyscript and matplotlib</p><p>Stil playing around with <a href="https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md">PyScript</a>.<br>
Didn't understand what the fuzz was about, Python in the browser is everywere after all. <br>
But the fact that you can embed it everywere is huge, no setting up servers, no search for sites that host your Python code, just a static website is enough :) <br>
Additionally to almost all the modules from the <a href="https://docs.python.org/3/library/">Python Standard Library</a> you can use over hundred external modules from <a href="https://pyodide.org/en/stable/usage/packages-in-pyodide.html">Pyodide</a>. <br>
Below is shown a simple graph in <a href="https://matplotlib.org/">matplotlib</a> that compares treasury bond rates from 2 different years.</p>
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<py-env>
- matplotlib
</py-env>
<py-script>
import matplotlib.pyplot as plt
labels = ['1 Mo','3 Mo','6 Mo','1 Yr','2 Yr','3 Yr','5 Yr','7 Yr','10 Yr','20 Yr','30 Yr']
july16_2007 =[4.75,4.98,5.08,5.01,4.89,4.89,4.95,4.99,5.05,5.21,5.14]
july16_2020 = [0.12,0.11,0.13,0.14,0.16,0.17,0.28,0.46,0.62,1.09,1.31]
fig, ax1 = plt.subplots()
ax1.plot(labels,july16_2007, color='blue', label="july16_2007")
ax1.set_ylabel("2007", color='blue')
ax1.spines['left'].set_color('blue')
ax1.spines['left'].set_linewidth(4)
for label in ax1.get_yticklabels():
label.set_color('blue')
ax2 = ax1.twinx()
ax2.plot(labels,july16_2020, color='red', label='july16_2020')
ax2.set_ylabel("2020", color='red')
ax2.spines['right'].set_color('red')
ax2.spines['right'].set_linewidth(4)
for label in ax2.get_yticklabels():
label.set_color('red')
plt
</py-script>
</body>
</html>Python in the Browser2022-06-21T00:00:00+02:002022-06-21T00:00:00+02:00streetyogitag:street.yoga,2022-06-21:/Pythonic Lotto Numbers.html<p>Sampled ranges inside the browser, how cool is that?</p><p>Python code embedded in html which samples random Austrian lottery numbers.<br>
Also prints the date and writes into labeled elements.<br>
Bear in mind that this is just a simple static website :)<br>
Uses <a href="https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md">PyScript</a>. Check it out for some examples. </p>
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<b><p>Today is <u><label id='today'></label></u></p></b>
<br>
<div id="lotto" class="alert alert-primary"></div>
<py-script>
import datetime as dt
from random import sample
pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y'))
pyscript.write('lotto', f'{sample(range(1,46), 6)}')
</py-script>
</body>
</html>Introducing streetyoga.capital2022-04-24T00:00:00+02:002022-04-24T00:00:00+02:00streetyogitag:street.yoga,2022-04-24:/money makes the world go round.html<p>Financial independence is part of Yoga</p><div class="gist">
<script src='https://gist.github.com/037f9a271324524e775e.js?file=Introducing_Streetyoga_Capital.md'></script>
<noscript>
<pre><code>As time passes by, street.yoga as a company has evolved, and so did I. Yoga will allways be my number one priority, that will never change.
But what is yoga exactly, or rather yoga darshana? It is the union between mind, body and spirit. I was focused on the spirit and the body,
but neglected my mind.
I'm still living in the market, allways will. I don't see myself moving to the himalayas and renounce the world,
renounce all thought and renounce my curiosity.
One of my passions preceding my yoga passion are computers and programming, and as much as I tried to renounce this passion to focus solely
on the physical and spiritual aspect of yoga, and tried to still my mind, it didn't work. And why should it? Computers are part of my life,
and every yogi on the internet. And as a yogi you are either willing to renounce that world or you are not. I am not. So today I started a
new project on github which will satiate my thirst for programming in the Python language.
I will post on my site about computers and yoga interchangeabely.
The new project I started concerns itself with algorithmic trading on different cryptocurrency exchanges and is located
at [streetyoga.capital](https://streetyoga.github.io/streetyoga.capital/).
I'm still open for my yoga business although I always struggled to take money for my services, it never felt right, it never will.
Namaste my dear yogis, and never forget to live by the eight limbs of yoga, even when participating in the market.</code></pre>
</noscript>
</div>Sentiment Of The Past2022-04-18T00:00:00+02:002022-04-18T00:00:00+02:00streetyogitag:street.yoga,2022-04-18:/The struggles of life.html<p>Motivate your self by the sweetness of inexperience</p><div class="gist">
<script src='https://gist.github.com/037f9a271324524e775e.js?file=Sentiment_Of_The_Past.md'></script>
<noscript>
<pre><code>Today I watched myself from a time when I started my company.
[![Yogangster](http://i3.ytimg.com/vi/OsHTLZ4L53U/hqdefault.jpg)](http://www.youtube.com/watch?v=OsHTLZ4L53U&list=LLYm_qdRj_vEtyTQx2dkX6Tw)
I was unexperienced but hungry and dedicated.
I miss those qualities. A Couple of months ago I was at my physical peak.
Despite working out hard, it wasn't the same, it was in fact easy,
almost slacking despite hours of bodyweight exercises and yoga every single day,
even running with weight.
Now I turned to programming in Python, telling myself that I have deposit enough onto my health account
and that it is ok to slack again for a while to get other things done.
My old self wouldn't approve such thinking, knowing where the priorities lie.
Let this post be a reminder to myself of my old me, being content and happy, not wanting but doing,
not dreaming but being, being present in my own me.
I am street yogi and i don't aprove the physical slacking, not for one minute, i found myself again.
</code></pre>
</noscript>
</div>Physical Health For Fitness2020-10-02T00:00:00+02:002020-10-02T00:00:00+02:00streetyogitag:street.yoga,2020-10-02:/Please do exercise.html<p>Traning has to become second nature, a habbit</p><div class="gist">
<script src='https://gist.github.com/037f9a271324524e775e.js?file=Physical_Health_For_Fitness.md'></script>
<noscript>
<pre><code>- [x] Self-esteem
I have been tested, I have passed through many tests
It is a gift from God that you have my attention, my life
- [x] Strength, Endurance
I have passed several physical endurance tests, my fitness is of the top 1% in the world
You will know my physical characteristics in a second
I am one of the few people who can do yoga, high-level body weight
- [x] Exercise videos in different languages
Video lessons and exercises to learn from the best
Videos about exercise
- [x] How it started
I was inspired to make an exercise program for people of all ages and levels
My wife and I are very active and love to travel
Since I was introduced to yoga, I started looking for alternatives for our health
I started making a list of my favorite yoga poses. The list got longer and longer
- [x] Long, progressive training sessions
Videos to enable self-reliant exercising for long term success
- [x] My primary goal is to encourage people to get outside and have fun and get active
The idea is that people will get back in shape and the world around them will be more fun
My goal is to make healthy living fun
- [x] Training is easy and rewarding
With your personal trainer to develop your skills in a safe and healthy environment
- [x] Training programs for individuals and groups
In addition to regular sessions and competitions
All forms of exercise are equally important to your health
If you exercise for long enough, it will become an intrinsic part of your life
It is important that you take the time to find the right physical activities for you
- [x] You can do more than you thought, no matter how busy your life may seem
</code></pre>
</noscript>
</div>Grepable Goodness2020-10-01T00:00:00+02:002020-10-01T00:00:00+02:00streetyogitag:street.yoga,2020-10-01:/All the oneliners you want.html<p>grep through it, hit enter, enjoy</p><div class="gist">
<script src='https://gist.github.com/4997128.js'></script>
<noscript>
<pre><code># grepable with inline comments.
# create alias: gh alias set cheat 'gist view 4997128'
# gh cheat | grep cheat -C 3, shows 3 lines before and after,
# Windows Powershell: gh cheat | Select-String cheat
bind -p | grep -v '^#\|self-insert\|^$' #list bash vim keybindings
shopt #shell options
bind -P #print keybindings
bash -x #print shellscript before executing, execute commands from file
help #brief summaries of builtin commands
fc #open last commandline in editor
kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }') #kill zombie processes
echo $0 #show if login shell or not, login shell has -bash
rm ./-somefileordir #remove file with hyphen
cd ./-somefileordir #change into dir with hyphen
type #type of command
type -a program #show path to all versions of program
export HISTTIMEFORMAT="%h/%d - %H:%M:%S " #shows date in historyfile
printf \t \n ... #formated print with tab and newline
grep -A 2 -B 3 foo README.txt # 2 lines before, 3 lines after
grep -C 3 foo README.txt # 3 lines before and after
xprop |grep WM_CLASS #get x11 window classname
echo "scale=2; x+y" | bc #calculations from cli, 2 decimals
echo "x*y" | bc -l #calculations from cli
sudo -s #stay in directory when sudo
man std::-->tab #c++ manpages
base64 #encode and decode using base64 representation
jq -r 'map(.Value | @base64d)' < file.json #decode base64 string of Value object
pdftotext my.pdf - | grep 'pattern' #grep through pdfs without writing txt file
yes foo > bar.txt #repeat some text (default is y) infinetly and save it to a file
strings #find the printable strings in a object, or other binary, file
mkfifo --mode=0666 /tmp/namedPipe #load SQL commands ...
gzip --stdout -d file.gz > /tmp/namedPipe #from gzipped file ...
LOAD DATA INFILE '/tmp/namedPipe' INTO TABLE tableName; #into database ...
java -version #java version
javac -version #java compiler version
ant -version #java make tool version
mvn #java project management tool
rcs #revision control system
tee #pipe to STDOUT and file
cal #display calendar
tidy #html parser
fmt #format text (TEX)
textutil #convert document-files
xpath #xml parser
xmllint #xml parser
locate -r "^\(.*/\)*header\.inc\.php$" #exact match
sqlite3 #sqlite cli interface ...
.databases #view databases ...
.open FILENAME #connect to database file ...
.tables #show tabes ...
.mode html #switch to html mode ...
.once FILENAME.html #query output to file ...
SELECT * FROM TABLE; # write content from table to FILENAME.html...
.quit #quit sqlite database ...
project.cj add overtone dep #overtone audio live coding
lein deps # ...
gibber #audiovisual live coding framework in javascript
xclip -sel clip < ~/.ssh/id_rsa.pub #copy from file to clipboard
sudo service start ssh start # start ssh daemon on WSL client and remotely connect to it
apt install <packet> # install gh in Kali, download deb: https://github.com/cli/cli/releases/latest</code></pre>
</noscript>
</div>Intro2019-11-06T00:00:00+01:002019-11-06T00:00:00+01:00streetyogitag:street.yoga,2019-11-06:/My USP.html<p>Never forget your USPs, everyone has something to contribute</p><p>As entrepreneur I develop workout concepts for the health-conscious:
* Short but periodic sequences for sedentary work, supervised and rewarded
* Yoga, body weight exercises, calisthenics, gymnastics (street workout). High- and parallel bars in parks, resistance bands, gymnastic rings, suspension trainers and climbing rope for progressive training in nature for individuals or small groups
* Videos to enable self-reliant exercising for long term success</p>Ziele setzen2017-05-29T19:51:12+02:002017-05-29T19:51:12+02:00streetyogitag:street.yoga,2017-05-29:/Eine Vision ist von Nöten.html<p>Setz dir kleine Ziele und nimm dir ein paar Minuten Zeit am Tag</p><p>Viele sportlich interessierte Menschen wissen entweder nicht wie sie sich Ziele setzten sollen oder es ist ihnen schlicht egal.<br />
Ziele sind jedoch eine integrale Komponente eines effektiven Programmes, lenken sie dich doch in einem strukturiertem Trainingsplan. Natürlich kannst du auch ohne gesetzter Ziele stetig voranschreiten. Setzt du dir jedoch qualitativ hochwertige Ziele, wird deine Leistung in die Höhe schießen.</p>
<blockquote class="alignment"><p>Ziele werden allgemein als "Das Ende in dessen Richtung die Mühe gelenkt wird" bezeichnet</p></blockquote>
<p>Bei körperlichen Übungen handelt es sich um konkrete Leistungen die man in Zahlen messen kann. Hier sind die greifbaren Ziele einer meiner Teilnehmerinnen:</p>
<ol>
<li>Einen freien Handstand für 10 Sekunden halten können.</li>
<li>Einen Barrensitz für 5 Sekunden halten können.</li>
<li>1 Minute lang frei am Reck hängen können.</li>
<li>10 Wiederholungen beim Rudern an den Ringen zu schaffen.</li>
<li>5 korrekte Klimmzüge ausführen zu können.</li>
<li>10 Liegestütze zu schaffen.</li>
<li>5 Barrenstütze zu bewältigen.</li>
<li>5 einbeinige Kniebeugen zu schaffen.</li>
</ol>
<p>Weitere konkrete Ziele könnten z.B. sein:</p>
<ol>
<li>400 Meter in 60 Sekunden zu laufen.</li>
<li>Körperfettanteil auf 15% zu reduzieren</li>
<li>5 kg an Muskelmasse zuzulegen.</li>
<li>5 kg an Fettmasse abzunehmen</li>
</ol>
<p>Wenn sich Anfänger zum ersten mal ein Ziel setzen, haben diese oft ein geringes Ausmaß an Qualität. Diese sind schlecht definiert und nicht in Zahlen ausgedrückt auf die hingearbeitet werden kann. Einige Beispiele schwammig formulierter Ziele wären z.B.:</p>
<ol>
<li>Sich bei Barrenstützen zu verbessern.</li>
<li>Beim Laufen nicht ausser Puste zu geraten.</li>
<li>Gewicht zu verlieren.</li>
<li>Muskeln aufzubauen.</li>
<li>Körperlich eine gute Verfassung zu erreichen.</li>
</ol>
<p>Ein Übungsprogramm hat konkrete Ziele als Basis. Wenn du dir als Ziel gesetzt hast 10 Barrenstütze zu schaffen ist es logisch die Kapazität für einen Barrenstütz aufzubauen, dann für zwei, drei, und so weiter bis du dein Ziel erreicht hast.</p>
<p>Ein anderer Weg um zu verstehen wie man sich konkrete Ziele setzt ist das SMART-Model:</p>
<ul>
<li><strong>S</strong>pezifisch</li>
<li><strong>M</strong>essbar</li>
<li><strong>A</strong>ktion</li>
<li><strong>R</strong>ealistisch</li>
<li><strong>T</strong>empo</li>
</ul>
<p>Du möchtest sicherstellen das deine Ziele ihren Zweck erfüllen. Nehmen Wir Adam und Monika als Beispiel: Adam möchte "stärker werden", hat sich aber als Ziel gesetzt 150 Liegestütze in Folge zu schaffen. Dies hat wenig Substanz da 150 Liegestütze in Folge eine effektive Übung für deine Ausdauer, nicht jedoch für deine Kraft sind. In einem anderen Beispiel möchte Monika "hervorragende Handstände" vorzeigen, ein Ziel, 30 Klimmzüge zu schaffen, wird sie jedoch nicht näher an diese Fähigkeit bringen.</p>
<p>Jetzt komme ich ins Spiel. Um sicher zu stellen das deine SMART-Ziele ihren Zweck erfüllen, zerlege ich deine gewünschte Fähigkeit in einzelne unterscheidbare Komponenten. Kehren wir als Beispiel zu Adam zurück, dem ich empfehlen würde extreme Krafttechniken aus der Gymnastik wie z.B. die Stützwaage, oder Kniebeugen mit seinem zweifachen Körpergewicht auf seinem Rücken, als Ziel zu verfolgen. Monikas Verlangen nach einem großartigen Handstand würde ich in zwei SMART-Ziele zerlegen, erstens, einen Handstand für 20 Sekunden gegen die Wand zu halten, und zweitens einen freien Handstand für 5 Sekunden zu halten.</p>
<p>Ein Widerspruch ist das viele Athleten glauben ihre Leistung durch Körpergewichtsübungen niedriger Intensität verbessern können. Adams ursprüngliches Ziel durch 150 Liegestütze in Folge "stärker zu werden" bedeutet nicht das er stark wird, sondern das er eine gute Ausdauer bei der Ausübung von Liegestützen erreicht.</p>
<blockquote><p>Zum Kraftaufbau durch das eigene Körpergewicht bedarf es eines gewissen Maßes an Kreativität und man sollte seinen Horizont erweitern. Wenn du es ernst meinst deine Ausdauer zu verbessern, ist es viel einfacher wenn du bereits stark und kräftig bist</p></blockquote>
<p>Ein Mangel an körperlicher Kraft wird dich immer in anderen Bereichen einschränken, sei es bei der richtigen Ausführung der Übungen, der Ausdauer, der gewünschten Fähigkeit, beim Gleichgewicht, bei deiner aktiven und passiven Flexibilität, deiner Beweglichkeit und Koordination. Körperliche Kraft um in diesen Bereichen zu glänzen wird vorausgesetzt, Defizite in diesen Domänen schränken deine Kraft jedoch meistens nicht ein, dies solltest du bei der Auswahl deiner Ziele beachten.</p>
<p>Zum Abschluss möchte ich noch etwas über unrealistische Ziele schreiben. Es ist einfach zu sagen das du einen Klimmzug schaffen willst, genug Übung vorausgesetzt, is dies relativ einfach zu erreichen. Andere setzen sich als Ziel 10 Liegestütze in der Stützwaage zu schaffen. Da es sich um eine schwierige Bewegung im fortgeschrittenen Kraftsegment handelt, ist es unrealistisch, 10 Wiederholungen von diesen zu schaffen, vergleichbar wären 10 Wiederholungen mit 250 kg beim Bankdrücken, genauso unrealistisch für die meisten.</p>
<p>Um Profizienz in Fähigkeiten zu erlangen, die den Fortgeschrittenen oder der Elite vorbehalten sind, bedarf es jahrelanger Übung. Das soll dich jetzt nicht entmutigen sondern dich dazu anspornen, vernünftige Ziele zu setzen die du auch erreichen kannst.</p>
<blockquote><p>Ziele zu erreichen ist ein großartiges Gefühl das dir genug Dynamik geben wird um dir neue Ziele zu setzten</p></blockquote>
<p>Wenn du deine Ziele nie erreichst dann wirst du schnell Ausreden finden die dich von deinem Trainingsplan abbringen.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>Dekonstruktion Einarmiger Handstand2015-12-20T22:18:02+01:002015-12-20T22:18:02+01:00streetyogitag:street.yoga,2015-12-20:/Oben ist Unten.html<p>So nah drann, 8 Finger :)</p><p>Bevor ich mein eigenes Tutorial poste, hier schon mal eine Interessante und ausführliche Beschreibung für alle<br>
die den einarmigen Handstand lernen wollen und den notwendigen Willen dazu aufbringen, in englischer Sprache. </p>
<p><img alt="Einarmiger Handstand" src="https://street.yoga/images/OAHS-v02.jpg"></p>
<p>Awesome guest post on one-armed handstands from Ryan Hurst of @gmbfit. If you want to do impressive stuff, <br>
this is definitely inspiring!</p>
<p>Quelle: <em><a href="http://chrissalvato.com/2013/07/case-study-achieving-the-one-arm-handstand-hold/">Deconstructing the One Arm Handstand - Chris Salvato</a></em></p>
<p style="text-align: left;">Sport Journal2013-03-10T00:00:00+01:002013-03-10T00:00:00+01:00streetyogitag:street.yoga,2013-03-10:/Liste an Übungen und Equipment.html<p>Gesammelt, praktiziert, vergessen, wiederbelebt</p><ul>
<li>Flexibility (Yoga, Stretching) </li>
<li>Core (Hanging Situps) </li>
<li>Acrobatics </li>
<li>Parcour </li>
<li>dance </li>
<li>Bodyweight (Barstarzz) </li>
<li>Jiu Jitsu </li>
<li>Thaybox </li>
<li>Studium </li>
<li>Paralletesübungen lt. American-Gymnast/Dr. Sommer </li>
<li>Krähe seitlich </li>
<li>Frontlever am Türreck lt. Dr. Sommer </li>
<li>Handstand an der Wand, Push ups auf Knöchel </li>
<li>Gewicht auf 1 Hand </li>
<li>kleine Schritte weg von der Wand bis reverse Planche, push ups </li>
<li>Kopfstand an der Wand, Füße Waagrecht, Kopf durchdrücken </li>
<li>Brücke auf Erhöhung in den Handstand </li>
<li>Dehnmaschine gerade, seitlich </li>
<li>Handtuch schultern dehnen (drehen, hinter Rücken hand oben, eine unten)</li>
<li>Liegestütz, Füße an der Wand, Sessel, TRX </li>
<li>Swissball: Situps, Rücken dehnen nach hinten, seitlich </li>
<li>Iron Cross zwischen 2 Stühlen oder Ringe, hängend (gravity boots) mit Gewichtern <a href="http://www.t-nation.com/free_online_article/sports_body_training_performance/the_iron_cross_for_bodybuilders">Dr. Sommer</a></li>
<li>Skorpion </li>
<li>Trainingsband, Rotatormanschetten und hinter Rücken </li>
<li>Rolle nach hinten in handstand/kopfstand/hollow back </li>
<li>Inventar: </li>
<li>Nackenschlaufe </li>
<li>Gravity boots </li>
<li>Trainingsband </li>
<li>Ringe </li>
<li>Sprossenwand </li>
<li>Saltogürtel/Turnweste </li>
<li>Fractional plates</li>
</ul>Paste columns in vim2011-06-30T00:00:00+02:002011-06-30T00:00:00+02:00streetyogitag:street.yoga,2011-06-30:/Vim as Excel alternative.html<p>Multi columns in Vim</p><p>Finaly, after years of searching, i found an almost perfect solution. </p>
<p>I sometimes like to write lists in vim which have 2 columns, or sometimes you copy something from the web and want to have it in two columns. </p>
<p>First you have the text in one column, then you go to the first row you want to have in the second column.<br>
Then you enter visual blockmode with Ctrl-V, then you press $, as not all rows will be the same length.<br>
Then scroll down with j and select all items you want to have in the second column.<br>
Then yank with y, or delete with x, go to the first corner of the second row and paste with p.</p>list only directories2011-06-13T00:00:00+02:002011-06-13T00:00:00+02:00streetyogitag:street.yoga,2011-06-13:/list-only-directories.html<p>Find all those files</p><p>This lists visible and hidden ones.</p>
<div class="highlight"><pre><span></span><code>ls<span class="w"> </span>-d<span class="w"> </span>*/<span class="w"> </span>.*/
</code></pre></div>rsync over ssh without rsync --daemon2011-06-10T00:00:00+02:002011-06-10T00:00:00+02:00streetyogitag:street.yoga,2011-06-10:/rsync-over-ssh-without-rsync-daemon.html<p>If you want to rsync without a daemon</p><div class="highlight"><pre><span></span><code>rsync<span class="w"> </span>-e<span class="w"> </span>ssh<span class="w"> </span>-l<span class="w"> </span>somefile<span class="w"> </span>someuser@someip:
</code></pre></div>clear scrollback buffer in terminal2011-06-06T00:00:00+02:002011-06-06T00:00:00+02:00streetyogitag:street.yoga,2011-06-06:/clear-scrollback-buffer-in-terminal.html<p>After all the work, clear it</p><p>clear and ^L: </p>
<p>clears window and sets cursor at beginning of window. </p>
<p>reset or ⌘K on Mac OSX: </p>
<p>clears whole scrollback buffer </p>No Sound in Java-apps in Firefox2008-07-26T00:00:00+02:002008-07-26T00:00:00+02:00streetyogitag:street.yoga,2008-07-26:/no-sound-in-java-apps-in-firefox.html<p>OSS Sequencer API</p><p>For a long time i had not sound in Firefox on Sites using Java (hobnox.com, runescape.com)</p>
<p>I tested the Javasound localy withe the JavaSoundDemo:</p>
<p>http://java.sun.com/products/java-media/sound/samples/JavaSoundDemo/</p>
<p>and i worked flawlessly.</p>
<p>I had to activate the OSS Sequencer API in the Kernel under:</p>
<p>Device Drivers/Sound/Advanced Linux Sound Architecture/</p>
<p>So even modern sites still use and need the OSS API, good to know :)</p>Searching ebuilds with useflag in Gentoo2008-07-20T00:00:00+02:002008-07-20T00:00:00+02:00streetyogitag:street.yoga,2008-07-20:/searching-ebuilds-with-useflag-in-gentoo.html<p>I wonder how that came onto my computer</p><p>Ever wondered how to find all those programms in portage you didn't install, which have a specific useflag you were interested in ?</p>
<p>Well, eix is capable of this useful feature, just search like this:</p>
<div class="highlight"><pre><span></span><code>eix<span class="w"> </span>-U<span class="w"> </span>someuseflag
</code></pre></div>Compare Directories with diff2008-05-15T00:00:00+02:002008-05-15T00:00:00+02:00streetyogitag:street.yoga,2008-05-15:/compare-directories-with-diff.html<p>So many files, deduplicate</p><p>Its easier than i thought, just type:</p>
<div class="highlight"><pre><span></span><code>diff<span class="w"> </span>-rq<span class="w"> </span>Dir1<span class="w"> </span>Dir2
</code></pre></div>
<p>-r stands for rekursive</p>
<p>-q output only wether content differ</p>Mounting ext4-filesystem with newer Kernels2008-05-14T00:00:00+02:002008-05-14T00:00:00+02:00streetyogitag:street.yoga,2008-05-14:/mounting-ext4-filesystem-with-newer-kernels.html<p>flags for development code</p><p>Trying to mount my ext4 partiton with a 2.6.25 kernel i get this errormessage:</p>
<div class="highlight"><pre><span></span><code>EXT4-fs: hda3: not marked OK to use with test code.
</code></pre></div>
<p>There is a new special flag you have to set to mount development code, so do:</p>
<div class="highlight"><pre><span></span><code><span class="o">[</span>root<span class="o">]</span><span class="c1"># debugfs -w /dev/hda3</span>
debugfs<span class="w"> </span><span class="m">1</span>.40.9<span class="w"> </span><span class="o">(</span><span class="m">27</span>-Apr-2008<span class="o">)</span>
debugfs:<span class="w"> </span>set_super_value<span class="w"> </span>s_flags<span class="w"> </span><span class="m">4</span>
debugfs:<span class="w"> </span>quit
</code></pre></div>
<p>More info, debugfs, ext4dev, <a href="https://fedoraproject.org/wiki/FedoraExt4">here</a>.</p>Syncing your portage tree and overlays with eix2007-12-26T00:00:00+01:002007-12-26T00:00:00+01:00streetyogitag:street.yoga,2007-12-26:/syncing-your-portage-tree-and-overlays-with-eix.html<p>Be more productive with oneliners</p><p>If you want to sync your portage tree and your layman-overlays with one command, you can use</p>
<div class="highlight"><pre><span></span><code>eix<span class="w"> </span>sync
</code></pre></div>
<p>for that.</p>
<p>All you have to do is to create</p>
<div class="highlight"><pre><span></span><code>/etc/eix-sync.conf
</code></pre></div>
<p>and place a
:::bash
*</p>
<p>in it.</p>
<p>If you want to have a cronjob for that create for example a file named /etc/cron.weekly/eix.cron</p>
<p>and put something like</p>
<div class="highlight"><pre><span></span><code><span class="ch">#!/bin/sh</span>
/usr/bin/eix-sync
</code></pre></div>
<p>in it.</p>
<p>You can then delete all other cronjobs like emerge --sync and layman -S</p>
<p>As usual man eix has all the info you need.</p>Java nada when libX11 compiled with xcb useflag2007-12-22T00:00:00+01:002007-12-22T00:00:00+01:00streetyogitag:street.yoga,2007-12-22:/java-nada-when-libx11-compiled-with-xcb-useflag.html<p>The fun of compiling code</p><p>Put</p>
<div class="highlight"><pre><span></span><code><span class="nv">LIBXCB_ALLOW_SLOPPY_LOCK</span><span class="o">=</span><span class="m">1</span>
</code></pre></div>
<p>in your /etc/env.d/99local</p>Enable Antispoofing With Iptables2007-10-01T00:00:00+02:002007-10-01T00:00:00+02:00streetyogitag:street.yoga,2007-10-01:/enable-antispoofing-with-iptables.html<p>Write to that proc filesystem</p><div class="highlight"><pre><span></span><code><span class="k">for</span><span class="w"> </span>i<span class="w"> </span><span class="k">in</span><span class="w"> </span>/proc/sys/net/ipv4/*/rp_filter
<span class="k">do</span>
<span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="m">1</span><span class="w"> </span>><span class="w"> </span><span class="nv">$f</span>
<span class="k">done</span>
</code></pre></div>
<p>Or simply</p>
<div class="highlight"><pre><span></span><code><span class="nb">echo</span><span class="w"> </span><span class="m">1</span><span class="w"> </span>><span class="w"> </span>/proc/sys/net/ipv4/*/rp_filter
</code></pre></div>
<p>(depends on your shell)</p>
<p>This compares the source adress against the routing table</p>
<p>More info about the ~50 options you can find at /usr/src/linux/Documentation/networking/ip-sysctl.txt</p>Redirect And Save Tcpdump Output To Other Host2007-09-28T00:00:00+02:002007-09-28T00:00:00+02:00streetyogitag:street.yoga,2007-09-28:/redirect-and-save-tcpdump-output-to-other-host.html<p>This are the times</p><p>So you have one of those fancy Linksys-Routers with OpenWrt on it and want to save the output of tcpdump. As the local storage is limited and OpenWrt does not support a monitoring-port you have to redirect the output to save on another host.</p>
<p>But first lets enlarge onto that monitoring-port.
For what i know DD-Wrt's iptables supports by default the ROUTE target with the <code>--tee</code> parameter:</p>
<div class="highlight"><pre><span></span><code>--tee
Make<span class="w"> </span>a<span class="w"> </span>copy<span class="w"> </span>of<span class="w"> </span>the<span class="w"> </span>packet,<span class="w"> </span>and<span class="w"> </span>route<span class="w"> </span>that<span class="w"> </span>copy<span class="w"> </span>to<span class="w"> </span>the<span class="w"> </span>given<span class="w"> </span>destination.<span class="w"> </span>
For<span class="w"> </span>the<span class="w"> </span>original,<span class="w"> </span>uncopied<span class="w"> </span>packet,<span class="w"> </span>behave<span class="w"> </span>like<span class="w"> </span>a<span class="w"> </span>non-terminating<span class="w"> </span>target
and<span class="w"> </span><span class="k">continue</span><span class="w"> </span>traversing<span class="w"> </span>the<span class="w"> </span>rules.
Not<span class="w"> </span>valid<span class="w"> </span><span class="k">in</span><span class="w"> </span>combination<span class="w"> </span>with<span class="w"> </span>--iif<span class="w"> </span>or<span class="w"> </span>--continue
</code></pre></div>
<p>I tried to patch OpenWrt's iptables with the ROUTE target, but no luck as this extensions seems not to be maintained anymore.</p>
<p>As DD-Wrt is OpenWrt-based, i supose i only need the ipkg from them and can install it on my router, have to investigate that further.</p>
<p>Far less complicated is to start tcpdump on your router and redirect the output to your PC like this:</p>
<div class="highlight"><pre><span></span><code>tcpdump<span class="w"> </span>-i<span class="w"> </span>any<span class="w"> </span>!<span class="w"> </span>host<span class="w"> </span><span class="m">192</span>.168.1.2<span class="w"> </span>-s<span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="p">|</span><span class="w"> </span>ssh<span class="w"> </span>someone@192.168.1.2<span class="w"> </span><span class="s2">"cat > dump.txt"</span>
</code></pre></div>
<p>Change tcpdump filters to your liking.</p>Enable And Disable Spell-Checking In Vim2007-09-24T00:00:00+02:002007-09-24T00:00:00+02:00streetyogitag:street.yoga,2007-09-24:/enable-and-disable-spell-checking-in-vim.html<p>Spellcheckers unite</p><p>First you choose the language which you want to use:</p>
<p><code>:setlocal spell spelllang=en_us</code></p>
<p>or </p>
<p><code>:setlocal spell spelllang=de_at</code></p>
<p>For the German spell files you have to:</p>
<p><code>emerge vim-spell-de</code></p>
<p>You can disable spellchecking with:</p>
<p><code>:set nospell</code></p>
<p><code>]s</code> move to next misspelled word, <code>[s</code> move to prev. misspelled word
<code>z=</code> suggests correctly spelled words under cursor,
<code>1z=</code> takes the first word from the suggestion list
<code>^Xs</code> does the same in insert mode.
<code>:spellr</code> repeats replacements done with <code>z=</code> for all matches</p>
<p>For more info about spellchecking in vim:</p>
<p><code>:h spell</code></p>Rename Or Copy Files Not In Current Directory2007-09-13T00:00:00+02:002007-09-13T00:00:00+02:00streetyogitag:street.yoga,2007-09-13:/rename-or-copy-files-not-in-current-directory.html<p>Autocompletion in zsh is the best</p><p>I often catched myself renaming a file in some other directory like this:</p>
<div class="highlight"><pre><span></span><code>mv<span class="w"> </span>some/dir/some/file<span class="w"> </span>some/dir/somefile_renamed
</code></pre></div>
<p>But there is an easier way:</p>
<div class="highlight"><pre><span></span><code>mv<span class="w"> </span>some/dir/some/<span class="o">{</span>file,file_renamed<span class="o">}</span>
</code></pre></div>
<p>This also works for copying:</p>
<div class="highlight"><pre><span></span><code>cp<span class="w"> </span>/etc/mail/<span class="o">{</span>sendmail.cf,sendmail.cf.orig<span class="o">}</span>
</code></pre></div>
<p>Or vimdiff:</p>
<div class="highlight"><pre><span></span><code>vimdiff<span class="w"> </span>/etc/mail/<span class="o">{</span>sendmail.cf,sendmail.cf.orig<span class="o">}</span>
</code></pre></div>
<p>And thats why I love zsh so much, you can even tabcomplete after the {, try that in bash f.e. :)
Be creative, I'm sure there are many useful fields of application.</p>Advanced Command-Line Editing2007-09-11T00:00:00+02:002007-09-11T00:00:00+02:00streetyogitag:street.yoga,2007-09-11:/advanced-command-line-editing.html<p>Lets celebrate my LPIC-2</p><p>Today I passed my 117-201 exam and now I play a little bit with the Vi key bindings on Zsh.<br>
In Bash you can set them with set -o vi, and in Zsh you can set them additionally with setopt vi. </p>
<p>I want to get to the point of command line editing above the basic<br>
tab complete and history browsing, searching and minor corrections.<br>
So I start witch a little example: </p>
<p>I want to rename a file with the following naming scheme:</p>
<p><code>someID_filename.txt to filename.txt</code></p>
<p>After my fulminant efficient Vim key combination for table editing, <a href="https://street.yoga/vim-contest-shortest-solution-postgresql-tab-to-array.html">Efficient table-editing</a> <br>
I challenge everybody to find the shortest key combination to fulfill this task.</p>
<p>I start with an self-deprating solution:
First I type:
<code>mv someID_filname.txt</code></p>
<p>Now the count begins:</p>
<p><code><Space><Esc>T_y$$p<Enter></code></p>
<p>This makes a total of 9 characters which i have to store in my brain. As I want
to have my head free for more complicated tasks, of course this has to
be optimized dramatically :) </p>
<p>Have fun. </p>GoogleEarth Freezes With Actual Ati-Drivers (No More)2007-08-30T00:00:00+02:002007-08-30T00:00:00+02:00streetyogitag:street.yoga,2007-08-30:/googleearth-freezes-with-actual-ati-drivers-no-more.html<p>Do you like shared objects?</p><p>There is a library missing, libGL.so.1 see <a href="https://web.archive.org/web/20160201121439/http://n01getsout.com/blog/2006/11/26/google-earth-for-linux-freezing-with-ati/">googleearth antifreeze</a> site for instructions.</p>
<p>Edit: Everything works fine for me now with latest googleearth (4.2.0198.2451 (beta)), no need to copy this library anymore as googleearth starts then in software-emulation mode. </p>Insert Current Date In Vim2007-08-27T00:00:00+02:002007-08-27T00:00:00+02:00streetyogitag:street.yoga,2007-08-27:/insert-current-date-in-vim.html<p>I don't know how to do that in vscode</p><p>If you write a ToDo list or a schedule in vim, you probably want to insert the current date or the date after one week from now.
Here is how to do it: </p>
<p><code>:r !date</code></p>
<p>or to add one week to the current Date: </p>
<p><code>:r !date -d "today 1 week"</code></p>
<p>enjoy :)</p>Move files beginning with an hyphen2007-08-19T00:00:00+02:002007-08-19T00:00:00+02:00streetyogitag:street.yoga,2007-08-19:/move-files-beginning-with-an-hyphen.html<p>Organization is important</p><p>This one is easy, as escaping does not work you have to prefix the filename with two hyphens like so:</p>
<p><code>mv -- -some_silly_filename_with_an_hyphen_before_it</code></p>Cannot connect with ipw2000 module2007-08-11T00:00:00+02:002007-08-11T00:00:00+02:00streetyogitag:street.yoga,2007-08-11:/cannot-connect-with-ipw2000-module.html<p>Module load error</p><p>Building a new kernel i couldn't connect annymore to my wlan-router, allthough i had the same configuration as my other kernel. Whell, almost, under Cryptographic options i build the AES cipher algorithms as module therefore the ieee80211_crypt_ccmp module could not find it , though i made a depmod. It gave me the errormessage:</p>
<p>ieee80211_crypt_ccmp: could not allocate crypto API aes</p>
<p>So apparently you have to build this into the kernel for wlan</p>gcc-config error: Could not run/locate "gcc"2007-07-23T00:00:00+02:002007-07-23T00:00:00+02:00streetyogitag:street.yoga,2007-07-23:/gcc-config-error-could-not-runlocate-gcc.html<p>gentoo is fun</p><p>Whenever switching gcc-versions, for example from 4.1 to 4.2 dont forget to do a:</p>
<p><code>gcc-config i686-pc-linux-gnu-4.2.0</code></p>Append yanked and deleted lines to registers in vim2007-07-13T00:00:00+02:002007-07-13T00:00:00+02:00streetyogitag:street.yoga,2007-07-13:/append-yanked-and-deleted-lines-to-registers-in-vim.html<p>Enigma was easier to crack than vim</p><p>Man, this never has an ending, so you already yank some files like this into a register:</p>
<p><code>"b3yy</code></p>
<p><code>"B3yy</code> appends the next 3 lines into the b-register</p>Vim commandline2007-07-13T00:00:00+02:002007-07-13T00:00:00+02:00streetyogitag:street.yoga,2007-07-13:/vim-commandline.html<p>Even before exams no rest for the vicked</p><p>Today i have my LPIC 101 exam, and while learning i tripped over this two examples:</p>
<p><code>vi +"set number" somefile.txt</code></p>
<p><code>vi +/sometext somefile.txt</code></p>
<p>The first one opens a file and numbers it and the second one opens a file and highlights the searchterm.</p>mysqlimport: Error: table full when using table2007-07-06T00:00:00+02:002007-07-06T00:00:00+02:00streetyogitag:street.yoga,2007-07-06:/mysqlimport-error-table-full-when-using-table.html<p>full tables aren't fun</p><p>If this error drives you mad on Gentoo, change this line in your /etc/mysql/my.cnf (if you use inoDB):</p>
<p><code>innodb_data_file_path = ibdata1:10M:autoextend:max:128M</code></p>
<p>and delete the :max:128M part or raise it up to your liking.</p>Browsing the Rails API with elinks using rails.vim2007-06-29T00:00:00+02:002007-06-29T00:00:00+02:00streetyogitag:street.yoga,2007-06-29:/browsing-the-rails-api-with-elinks-using-railsvim.html<p>I'm using elinks to browse the Rails API</p><p>Add this line to your .vimrc</p>
<p>`command -bar -nargs=1 OpenURL :!elinks <args></p>Map multiple piped commands in vim2007-06-22T00:00:00+02:002007-06-22T00:00:00+02:00streetyogitag:street.yoga,2007-06-22:/map-multiple-piped-commands-in-vim.html<p>I seldom map, but I do map multiple commands in vim</p><p>If you want to map multiple commands in vim do it like this:</p>
<p>nmap <F1> :w|!ruby %>;CR></p>
<p>imap <F1> <Esc>:w|!ruby %<CR></p>
<p>This writes the actual file to disk and evaluates it through the ruby interpreter when you hit the F1-key.</p>
<p>Alternatively you can do a:</p>
<p>:nmap <F1> :w|rubyf %<CR> (no space after the %)</p>
<p>:imap <F1> <Esc>:w|rubyf %<CR></p>
<p>which should be faster, condition is you have to build vim with ruby support, but sometimes i get no results with this , vim gets crashed or does not respond anymore to me...</p>
<p>This mappings work both in insert- and command-mode</p>zsh and the stat command2007-06-22T00:00:00+02:002007-06-22T00:00:00+02:00streetyogitag:street.yoga,2007-06-22:/zsh-and-the-stat-command.html<p>there was a time when people knew their file systems</p><p>It works a litte bit different than in bash:</p>
<p><code>stat -g some_file</code></p>
<p>Shows the times in GMT</p>
<p><code>stat -s some_file</code></p>
<p>Shows the times in local time zone</p>
<p>You can find more about zsh's stat with <code>man zshmodules</code> under zsh/stat</p>Some handy vim commands2007-06-20T00:00:00+02:002007-06-20T00:00:00+02:00streetyogitag:street.yoga,2007-06-20:/some-handy-vim-commands.html<p>Years of practice, still no memorization</p><p>I want to have them in one place so i write them down here:</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:g/^#/d</tt></span> Delete all lines that begins with #</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:g/^$/d</tt></span> Delete all lines that are empty and contain no tabs</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:g/^\s*$/d</tt></span> Delete all lines that are empty</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:%s/$/{ctrl-V}{CR}/g</tt></span> Inserts blank line between lines <span style="background-color:#ddffdd;color:#000000;font-weight:bold;"></span></p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:%s/{TAB}*$//</tt></span> Strip tabs at end of line</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>:g/<pattern>/t$</tt></span> Copy every line which matches pattern to the end of the file</p>
<p><span style="background-color:#ddffdd;color:#000000;font-weight:bold;"><tt>5>></tt></span> indent 5 lines from line where cursor stands, handy because you dont need to enter visual mode</p>
<p>And yes, {ctrl-V},{CR} and {TAB} means you have to press it, not to type it.</p>
<p>Credits go to <a href="http://gentoo-wiki.com/HOWTO_VIM" title="vim howto" target="_blank">gentoo- wiki.com</a>, <a href="http://www.yolinux.com/TUTORIALS/LinuxTutorialAdvanced_vi.html" title="vim tips" target="_blank">yolinux.com</a> and <a href="http://www.int-x.org/doku.php?id=tipps:vimtipps" title="vim tips" target="_blank">www.int-x.org</a></p>Error when installing instiki with RubyGems2007-06-19T00:00:00+02:002007-06-19T00:00:00+02:00streetyogitag:street.yoga,2007-06-19:/error-when-installing-instiki-with-rubygems.html<p>Errors, errors, love them</p><p>clean_logger.rb:13:in `remove_const': constant Logger::Format not defined (NameError)</p>
<p>change from this:</p>
<p>remove_const "Format"</p>
<p>to this:</p>
<pre>
remove_const "Format" if const_defined? "Format"</pre>
<p>because the newer version of logger.rb does not include the line:</p>
<p>Format = "%s, [%s#%d] %5s -- %s: %s\n"</p>
<p>Edit:</p>
<p>The instikiversion in rubygems is so outdated, just download latest version from http://www.instiki.org/ which works fine.</p>Skype 1.4 on Gentoo: Database Error2007-06-18T00:00:00+02:002007-06-18T00:00:00+02:00streetyogitag:street.yoga,2007-06-18:/skype-14-on-gentoo-database-error.html<p>Skype always was a little too comunicative</p><p>This is because skype does not get shut down when i close it, i have to kill it manually too. (I use dwm and have no try icon)</p>
<p>Another Error was dbus-related, i had to start /etc/init.d/dbus.</p>Switch case under cursor in vim2007-06-15T00:00:00+02:002007-06-15T00:00:00+02:00streetyogitag:street.yoga,2007-06-15:/switch-case-under-cursor-in-vim.html<p>As if I would find it here ;)</p><p>I rarely need this but maybe it comes handy some day :)</p>
<p>just pres the tilde ==> ~</p>Howto set ATI Powerplay2007-06-14T00:00:00+02:002007-06-14T00:00:00+02:00streetyogitag:street.yoga,2007-06-14:/howto-set-ati-powerplay.html<p>More Power, urgh urgh</p><div class="highlight"><pre><span></span><code>aticonfig<span class="w"> </span>--set-powerstate<span class="o">=</span><span class="m">1</span><span class="w"> </span><span class="c1"># powerstate=3 to get full power again</span>
</code></pre></div>
<p>For a listing of modes</p>Pasting in vims insertmode2007-06-13T00:00:00+02:002007-06-13T00:00:00+02:00streetyogitag:street.yoga,2007-06-13:/pasting-in-vims-insertmode.html<p>What to do with that paste?</p><p>Sometimes you are already in vims insert mode, yanked something and want to paste it, instead of leaving insert mode, pasting, and enter insert mode again, type CTRL-O, paste with p, and you get back to insert mode automatically. Works of course for all normal mode commands.</p>Vim contest: shortest solution postgreSQL tab to array2007-06-13T00:00:00+02:002007-06-13T00:00:00+02:00streetyogitag:street.yoga,2007-06-13:/vim-contest-shortest-solution-postgresql-tab-to-array.html<p>To all the Vim wizards out there</p><p>Maybe some of you have realised that i became a little obsessed in the last days using vim.</p>
<p>Inspired by this Blog <a href="http://helmi-blebe.blogspot.com/2007/04/vim-tips-blockwise-selection-mode-and.html" title="fast table editing in vim" target="_blank">entry</a> I want to start a contest.</p>
<p>Who finds the fastest solution of editing a given postgre table and changing it into an given array ?</p>
<p>What you can win ? Well, the satisfaction of being the only true vim-master of the world :)</p>
<p>That said, here the general framework.</p>
<p>First the table we use in our contest:</p>
<pre>col1 | integer | not null
col2 | timestamp without time zone | not null
col3 | character varying(100) |
col4 | numeric |
col5 | numeric |
col6 | integer |
col7 | integer |
col8 | numeric |
col9 | numeric |
col10 | character varying(100) |
col11 | character varying |
col12 | character varying(100) | not null
col13 | character varying |
col14 | character varying |
col15 | numeric |
col16 | numeric |
col17 | numeric |
col18 | character varying |
col19 | numeric |</pre>
<p>There are no lines before or after this table, and no spaces before or after this table</p>
<p>This table we want to alter into this:</p>
<pre>$ary = array('col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7','col8',
'col9','col10', 'col11', 'col12', 'col13', 'col14', 'col15', 'col16', 'col17',
'col18', 'col19');</pre>
<p>The array has to begin at the left topmost corner too</p>
<p>We start at the top left corner in normal mode</p>
<p>textwidth is set to 78</p>
<p>tabstop is set to 8</p>
<p>shiftwidth is also set to 8</p>
<p>all relevant settings i did not mention here shall not be altered from the default configuration</p>
<p>only standard keymappings of vim 7.1 are allowed, no abbreviations</p>
<p>So the best would be to start it like this: vim -u NONE</p>
<p>The ending position of the cursor does not matter, as well as the mode in which you are when you finished</p>
<p>Every keystroke will be counted, so when a shift- or ctrl-key has to be pressed, this counts as an extra keystroke</p>
<p>I use a German keyboard so my keystrokes will differ from the English ones, of course, for those people with different keyboards, when someone with an English keyboard finds the fastest solution, the keystrokes of the other keyboards will be translated to the English one and vice versa :)</p>
<p>As i am pretty sure there will be some obscurities because of the endless possibilities of vim, they will be discussed and added to the framework.</p>
<p>So let me begin with my first solution:</p>
<p><CTRL-V>GI'<Esc>qqelC',<Esc>+q18@qs);<Esc>ggi$ary = array(<Esc>VGq</p>
<p>This makes a total of :</p>
<blockquote> 57 keystrokes</blockquote>
<p>on a German keyboard, this will be converted to the amount of keystrokes on an English keyboard, if needed. I'm very sure it takes less strokes on an English one.</p>
<p>Lets see this test also as an benchmark for other editors, but if you use the mouse, every move of the arm counts as 1 keystroke, so when you grab for the mouse and click something, this counts as 2 keystrokes, not counting the clicks of course, if you move your arm after the click back to your keyboard again, this counts as another keystroke, if you click something else this move counts as another keystroke, if the icons are side by side then only the click is counted.</p>
<p>We have our first winner, this is Matt's solution:</p>
<p>i$ary = array(<Esc>lqqi'<Esc>f C',<Esc>+q99@qs);<Esc>vggJX</p>
<p>Makes a total of:</p>
<blockquote>53 keystrokes (converted to a German keyboard)</blockquote>
<p>Actually the last X is from me, but i'm cocksure he would find that out for himself :)</p>
<p>And the master is on the road again, here my improved version of Matts version:</p>
<p>i$ary = array(<CTRL-O>qq'<Esc>f C',<Esc>+q99@qs);<Esc>vggJX</p>
<p>Makes a total of:</p>
<blockquote> 52 keystrokes</blockquote>Change working directory from vim2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/change-working-directory-from-vim.html<p>Is it an editor or lifestyle?</p><p>To change the working directory in vim you have to type :cd or :cd! to force it, not :!cd as this does nothing to my understanding</p>Compare two files in vim, already opened in split windows2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/compare-two-files-in-vim-already-opened-in-split-windows.html<p>diff, diff , diff that thing</p><p>Type diffthis in both windows to enter diffmode, voila :)</p>Extract File From Tar-Archive Without Specifying Directory2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/extract-file-from-tar-archive-without-specifying-directory.html<p>Storage is expensive</p><p><code>tar xvf some.tgz --no-anchored some.txt</code></p>
<p>When some.txt is in /some/dir/some.txt, some.txt gets extracted right there.</p>Fast search and replace in vim2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/fast-search-and-replace-in-vim.html<p>The fastest editor in the world</p><p>Today a fast search and replace technique in vim, I copy an example direct from the vimhelp:</p>
<div class="highlight"><pre><span></span><code><span class="o">/</span><span class="nx">foo</span><span class="p"><</span><span class="nx">CR</span><span class="p">></span><span class="w"> </span><span class="nx">find</span><span class="w"> </span><span class="s">"foo"</span>
<span class="nx">c</span><span class="c1">//e change until end of match</span>
<span class="nx">bar</span><span class="p"><</span><span class="nx">Esc</span><span class="p">></span><span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="nx">replacement</span>
<span class="c1">//<CR> go to start of next match</span>
<span class="nx">c</span><span class="c1">//e change until end of match</span>
<span class="nx">beep</span><span class="p"><</span><span class="nx">Esc</span><span class="p">></span><span class="w"> </span><span class="k">type</span><span class="w"> </span><span class="nx">another</span><span class="w"> </span><span class="nx">replacement</span>
<span class="nx">etc</span><span class="p">.</span>
</code></pre></div>Installing vimball-archives2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/installing-vimball-archives.html<p>extend that thing</p><p>Open the .vba file in vim, so that you can see the source and then type:</p>
<p><code>:so %</code></p>Invalid char when starting scripts2007-06-11T00:00:00+02:002007-06-11T00:00:00+02:00streetyogitag:street.yoga,2007-06-11:/invalid-char-when-starting-scripts.html<p>bomb or nobomb, that is here the question (it's nobomb)</p><p>foobar.rb:1: Invalid char <code>\357' in expression
foobar.rb:1: Invalid char</code>\273' in expression
foobar.rb:1: Invalid char `\277' in expression</p>
<p>Your script gives you this error and and vim shows nothing ? Try to set :set nobomb and save the file.</p>
<p>When you start vim in binarymode, vim -b foobar.rb, than you see the invalid chars</p>Grep only through hidden files2007-06-10T00:00:00+02:002007-06-10T00:00:00+02:00streetyogitag:street.yoga,2007-06-10:/grep-only-through-hidden-files.html<p>More data, I need more!</p><p>grep <pattern> .*</p>
<p>This greps through all dotfiles in the current directory</p>Howto transpose two letters in vim2007-06-10T00:00:00+02:002007-06-10T00:00:00+02:00streetyogitag:street.yoga,2007-06-10:/howto-transpose-two-letters-in-vim.html<p>hint, it sounds like an operating system that brought me to linux</p><p>This is just a simple reminder, type xp.</p>Macros in Vim2007-06-06T00:00:00+02:002007-06-06T00:00:00+02:00streetyogitag:street.yoga,2007-06-06:/macros-in-vim.html<p>hit that record button</p><p>Ever wondered what this recording means when you accidentally hit the q-key and then another key ?</p>
<p><code>q{0-9a-zA-Z"}</code> starts recording a macro</p>
<p><code>q</code> stops recording the macro</p>
<p><code>@{0-9a-zA-Z"}</code> starts the macro</p>
<p><code>@@</code> repeats last used macro</p>dwm shows white background with java2007-06-03T00:00:00+02:002007-06-03T00:00:00+02:00streetyogitag:street.yoga,2007-06-03:/dwm-shows-white-background-with-java.html<p>dwm, it whips the memorys ass</p><p>I was for a search for a wm only for javaapps because of this (fvwm-crystal is very nice btw. but only with the mouse, although they claim you can operate it only with the keyboard, for me it was poore brain-damage), but there is a simple solution for this:</p>
<p><code>export AWT_TOOLKIT=MToolkit</code></p>
<p>Never ever another WindowManager again :)</p>Create directories using brace expansion2007-05-30T00:00:00+02:002007-05-30T00:00:00+02:00streetyogitag:street.yoga,2007-05-30:/create-directories-using-brace-expansion.html<p>the hidden mysteries of the braces</p><p>Say you wan't to create several directories, for example rc0.d to rc6.d (vmware needs them for example to install)</p>
<p>you type:</p>
<p><code>mkdir rc{0..6}.d</code></p>Vmware-Workstation 6.0 On Gentoo2007-05-30T00:00:00+02:002007-05-30T00:00:00+02:00streetyogitag:street.yoga,2007-05-30:/vmware-workstation-60-on-gentoo.html<p>If it doesn't work, just write an ebuild</p><p>Today i installed VMware-workstation-.0.0.45731. if you get this error:</p>
<p>/opt/vmware/workstation/lib/vmware/bin/vmware: symbol lookup error: /opt/vmware/workstation/lib/vmware/lib/libvmwareui.so.0/libvmwareui.so.0: undefined symbol: _ZN3Gtk6Widget14get_accessibleEv</p>
<p>start it like this:</p>
<p>VMWARE_USE_SHIPPED_GTK=yes vmware</p>
<p>btw, the vmwareinstaller needs the runleveldirectories rc0.d-rc6.d, just create symlinks to the runlevels of gentoo,</p>
<p>there is also an <a href="http://bugs.gentoo.org/show_bug.cgi?id=177876" title="vmware ebuild" target="_blank">ebuild</a> on bugs.gentoo.org, somebody pointed out to get it working after some modifications to i386.</p>
<p>Edit: vmware-workstation-6 is allready in portage, just unmask it and also unmask latest vmware-modules.</p>Searching for faces2007-05-29T00:00:00+02:002007-05-29T00:00:00+02:00streetyogitag:street.yoga,2007-05-29:/searching-for-faces.html<p>all your base are belong to us</p><p>Came today across a new feature g00gle offers.</p>
<p>Search for something on G00gle Image Search, for example</p>
<p>images.google.com/images?q=somesearchterm and add &imgtype=face to that url so with</p>
<p>images.google.com/images?q=somesearchterm&imgtype=face you get only faces listed.</p>Strange zsh proposals for correction2007-05-29T00:00:00+02:002007-05-29T00:00:00+02:00streetyogitag:street.yoga,2007-05-29:/strange-zsh-proposals-for-correction.html<p>sometimes you have to bend the machine to your will</p><p>I often got strange proposals from zsh command correction (setopt correctall), for example:
zsh: correct ’sudo’ to ‘_sudo’ [nyae]?</p>
<p>A rehash -f helped</p>
<p>Also have to look at the HASH_LIST_ALL option some time.</p>BiLE-weigh.pl: sort: open failed: +1: No such file or directory2007-05-27T00:00:00+02:002007-05-27T00:00:00+02:00streetyogitag:street.yoga,2007-05-27:/Bile sorting with perl.html<p>Command line voodoo</p><p>Simply change this line from:</p>
<div class="highlight"><pre><span></span><code><span class="sb">`</span>cat<span class="w"> </span>temp<span class="w"> </span><span class="p">|</span><span class="w"> </span>sort<span class="w"> </span>-r<span class="w"> </span>-t<span class="w"> </span><span class="s2">":"</span><span class="w"> </span>+1<span class="w"> </span>-n<span class="w"> </span><span class="p">&</span>gt<span class="p">;</span><span class="w"> </span>@ARGV<span class="o">[</span><span class="m">1</span><span class="o">]</span>.sorted<span class="sb">`</span><span class="p">;</span>
</code></pre></div>
<p>to:</p>
<div class="highlight"><pre><span></span><code><span class="sb">`</span>cat<span class="w"> </span>temp<span class="w"> </span><span class="p">|</span><span class="w"> </span>sort<span class="w"> </span>-r<span class="w"> </span>-t<span class="w"> </span><span class="s2">":"</span><span class="w"> </span>-k<span class="w"> </span><span class="m">1</span><span class="w"> </span>-n<span class="w"> </span><span class="p">&</span>gt<span class="p">;</span><span class="w"> </span>@ARGV<span class="o">[</span><span class="m">1</span><span class="o">]</span>.sorted<span class="sb">`</span><span class="p">;</span>
</code></pre></div>Howto create md5 password-hashes for amule2007-05-23T00:00:00+02:002007-05-23T00:00:00+02:00streetyogitag:street.yoga,2007-05-23:/howto-create-md5-password-hashes-for-amule.html<p>Safety first</p><p>to connect to your amuled you need to save your password as md5-hash in your .aMule/amule.conf.</p>
<p>Here is how you create one:</p>
<p><code>echo -n password | md5sum | cut -d ' ' -f 1</code></p>ettercap on openwrt (whiterussian 0.9)2007-05-16T00:00:00+02:002007-05-16T00:00:00+02:00streetyogitag:street.yoga,2007-05-16:/ettercap-on-openwrt-whiterussian-09.html<p>No wonder its called whiterussian</p><p>Tried to install ettercap on a Linksys WRT54GL, but the version in the repository misses some dependencies.</p>
<p>You have to install zlib and libpthread. Also the libncurses package misses some libraries, thats why i downloaded it from <a href="http://openwrt.vcp-springe.de/experimental/ettercap/" title="libncurses with missing libraries" target="_blank">here</a> and installed it with ipkg install libncurses_5.2-8_mipsel.ipk</p>Howto rebind keys in weechat2007-05-05T00:00:00+02:002007-05-05T00:00:00+02:00streetyogitag:street.yoga,2007-05-05:/howto-rebind-keys-in-weechat.html<p>weechat r00l3z</p><p>I found it difficult to grab allways to the F6 and F7 keys to switch buffers, so i remaped them to ctrl-P and ctrl-N. Here is how:</p>
<p>/key ctrl-N /buffer +1</p>
<p>/key ctrl-P /buffer -1</p>
<p>Because my Alt-K key is mapped in dwm to switch windows, i get keycodes in weechat witch /key call grab_key, and press then the key i need the code for.</p>
<p>dont forget to /save.</p>tar don't needs -z and -j anymore! (Well since 2004)2007-05-05T00:00:00+02:002007-05-05T00:00:00+02:00streetyogitag:street.yoga,2007-05-05:/tar-dont-needs-z-and-j-anymore-well-since-2004.html<p>all the balast of the tar command</p><p>I am a little bit disappointed, today i found out that you don't have to specify the -z or -j parameter to tar, man, how much time i spent to choose the right parameter and it was that easy the whole time :)</p>Howto use scp2007-05-04T00:00:00+02:002007-05-04T00:00:00+02:00streetyogitag:street.yoga,2007-05-04:/howto-use-scp.html<p>Not one times, not two times, but always I forget</p><p>Forgetful as i am here a simple reminder how to use scp:</p>
<p><code>scp /some/file root@192.168.1.1:newnameoffile</code></p>
<p>or simpy:</p>
<p><code>scp /some/file root@192.168.1.1:</code></p>
<p>to copy the file under the same name.</p>
<p>Want to copy a whole directory ?</p>
<p><code>scp -r some/dir root@192.168.1.1:</code></p>Hints to start Processes in Background (zsh) and logging out2007-04-30T00:00:00+02:002007-04-30T00:00:00+02:00streetyogitag:street.yoga,2007-04-30:/hints-to-start-processes-in-background-zsh-and-logging-out.html<p>nohupidihup</p><p>Start the process with nohup:</p>
<p><code>nohup someprocess</code></p>
<p>When it is allready started, type disown. (alias disown="kill -CONT %1; disown" or alias disown="bg; disown" to not to have to kill or bg manualy)</p>
<p>Start the process with &! which automatically disowns the process.</p>
<p>Start the program in the background, either with</p>
<p>program & or ^Z bg, then type kill -9 $$ (this one closes also the actual shell).</p>Sorting Directories On Size, Human Readable2007-04-28T00:00:00+02:002007-04-28T00:00:00+02:00streetyogitag:street.yoga,2007-04-28:/sorting-directories-on-size-human-readable.html<p>Linux madness</p><p>So far i have this:</p>
<p><code>du -h --max-depth=1 | grep '[0-9]K' | sort -n ; du -h --max-depth=1 | grep '[0-9]M' | sort -n | du -h --max-depth=1 | grep '[0-9]G' | sort -n</code></p>
<p>To include regular files in this sorting just use du -ah instead...</p>
<p>Edit: A far better version as pointed by <a href="http://deice.daug.net/" target="_blank">deice</a> is:</p>
<pre>
<code>
du -s * | sort -n | cut -f 2- | while read a; do du -hs $a; done
</code></pre>Forcing udma5 on laptop (Acer Aspire 1692 wlmi)2007-03-11T00:00:00+01:002007-03-11T00:00:00+01:00streetyogitag:street.yoga,2007-03-11:/forcing-udma5-on-laptop-acer-aspire-1692-wlmi.html<p>without 80 wire ribbon cable and parallel ATA (P-ATA) interface</p><p class="snap_preview">For some time past i bought a hitachi
travelstar 7k100 and to my surprise i could not set udma5 with hdparm,
the kernel restricted the settings to udma2 because it could not find a
80 wire ribbon cable. as i am not willing to solder one in my notebook,
i added the kernelparameter ide0=ata66 to my grub.conf and now i can
change to udma5 with hdparm. hopefully this parameter will stay for
long time as its allready depreciated and i don’t know if it will be
replaced by something else.
<p class="snap_preview"> </p>
<p class="postfeedback"> </p>Changing the timestamp of some files in a directory2007-03-10T00:00:00+01:002007-03-10T00:00:00+01:00streetyogitag:street.yoga,2007-03-10:/changing-the-timestamp-of-some-files-in-a-directory.html<p>do you remember the touch command?</p><p>Lets assume i want to change the timestamp of all pdf-files in a directory to now, this is the way to go (zsh):<br /><br />for file in *.pdf; touch ${file}<br /><br /></p>Search for a file with specific content2007-03-08T00:00:00+01:002007-03-08T00:00:00+01:00streetyogitag:street.yoga,2007-03-08:/search-for-a-file-with-specific-content.html<p>the search never ends</p><p>Found a site which describes this quite good (german):</p>
<p><a href="http://www.linuxfocus.org/Deutsch/September1998/article64.html">http://www.linuxfocus.org/Deutsch/September1998/article64.html</a></p>
<p>Lets do some comparison and search the whole root directory for the string "PAGER":</p>
<p>Lazy as i am i first started with the shortest possibility:</p>
<p><em>grep "PAGER" <code>find / -type f -print</code></em></p>
<p>Does not find anything for me, zsh gives me an error "argument list too long"</p>
<p>Here some explanation why this is so:</p>
<p><a href="http://michael-prokop.at/blog/2007/02/26/argument-list-too-long/">http://michael-prokop.at/blog/2007/02/26/argument-list-too-long/</a></p>
<p>getconf ARG_MAX shows us the limit of 131072 characters allowed passing the command-line at once.,</p>
<p>So lets try something else, this time using xargs, which breaks the command down below 131072 characters:</p>
<p><em>find / -type f -print | xargs grep "PAGER"</em></p>
<p>Little bit better now, but, when i come across files with spaces in the filename i get problems, so lets try it again:</p>
<p><em>find / -type f -print0 | xargs -0 grep "PAGER"</em></p>
<p>ok, this finally works. Somewhere someone shouted out that the parameters -print0 and -0 are not posix compliant, so for you purists out there another working solution:</p>
<p><em>find / -type f -exec grep "PAGER" /dev/null {} \;</em></p>Search gentoo portage-trees with eix for multiple words2007-03-03T00:00:00+01:002007-03-03T00:00:00+01:00streetyogitag:street.yoga,2007-03-03:/search-gentoo-portage-trees-with-eix-for-multiple-words.html<p>regex are words is a language</p><p>Edit:</p>
<p>You can, now ?, use multiple arguments of -S to achieve the same result so:</p>
<p><code> eix -S 'cd' -S 'writ' </code></p>
<p>works the same.
Thanks goes to Emil Beinroth for this hint.</p>
<p>All i wanted to do, was to search gentoo's package descriptions for two words, quite after or nearby. How could i know that this proved to be so hard :)</p>
<p>After long research i found on a site a regexp doing more or less that what i wanted:</p>
<p><a href="http://www.regular-expressions.info/near.html" title="Regular Expressions" target="_blank">http://www.regular-expressions.info/near.html</a></p>
<p>Of course it malfunctioned, so i tried to adapt it to eix.</p>
<p>Here my results so far, help and improvement suggestions appreciated :):</p>
<p>So when i try for example to search for the words 'cd' and 'writing' i type:</p>
<p><code>eix -S 'cd(\W<em>\w</em>){9}writing|writing(\W<em>\w</em>){9}cd'</code></p>
<p>Spoken:</p>
<p>find the word 'cd', followed by some non-alphanumerics (or not), followed by some alphanumerics (or not) and repeat this alphanumerics - non-aphanumerics thingie for my sake 9 times before you search for the word 'writing' (so this match finds only to a maximum of 8 words between 'cd' and 'writing'). Then reverse the two words and do the same sh...</p>
<p>Then try this same with 'write' or 'writ', there are at least 6 applications which don't have the word 'burn' in their descriptions, it could be that easy :)</p>
<p>at least i have united k3b and xcdroast in one search result, so that all was not for nothing :)</p>exclude directories from find2007-01-28T00:00:00+01:002007-01-28T00:00:00+01:00streetyogitag:street.yoga,2007-01-28:/exclude-directories-from-find.html<p>not everything wants to be found</p><p>To exclude dirs from the find command:</p>
<div class="highlight"><pre><span></span><code>find<span class="w"> </span>/<span class="w"> </span>-path<span class="w"> </span><span class="s1">'/some/dir'</span><span class="w"> </span>-prune<span class="w"> </span>-o<span class="w"> </span>-name<span class="w"> </span><span class="s1">'*.txt'</span><span class="w"> </span>-ls
</code></pre></div>Automatically save Foldings in vim2007-01-26T00:00:00+01:002007-01-26T00:00:00+01:00streetyogitag:street.yoga,2007-01-26:/automatically-save-foldings-in-vim.html<p>folding, the essence of life</p><p>Normaly you have to type allways :mkview and :loadview to save your folds, so simply add this two lines to your ~/.vimrc:</p>
<p><a href="http://applications.linux.com/article.pl?sid=06/05/18/1915233&tid=13"></a></p>
<blockquote> au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview</blockquote>
<p>Now, each time you close a file, its fold state will be saved and reloaded when you reopen the file in Vim.</p>
<p><strike>Edit:</strike></p>
<p><strike>When I open new empty files from the shell or from Vim (:new)</strike></p>
<p><strike>I get the error message:</strike></p>
<p><strike>Error detected while processing BufWinEnter Auto commands for "*":</strike></p>
<p><strike>E32: No file name</strike></p>
<p><strike>This also happens when opening :help window and sourcing sessions with</strike></p>
<p><strike>the shell command "vim -S session.vim". Have to find a way to run automatic :loadview only for windows that actually have a filename</strike></p>securing apache2007-01-26T00:00:00+01:002007-01-26T00:00:00+01:00streetyogitag:street.yoga,2007-01-26:/securing-apache.html<p>everything has to be rewritten, I said everything</p><p>Try to summarize some settings to secure apache:</p>
<p>*) Disable TRACE:</p>
<p><span class="body"></span></p>
<pre>RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]</pre>
<p>mod_rewrite is needed, also has to be done in the
<VirtualHost www.example.com> section.</p>Copy and Paste from Web to Vim2007-01-12T00:00:00+01:002007-01-12T00:00:00+01:00streetyogitag:street.yoga,2007-01-12:/copy-and-paste-from-web-to-vim.html<p>vim meets the web</p><p>Normaly autoindent is enabled, so it looks horrible when you paste something from an webpage into vim.
So before you do this, type:</p>
<p><em>:set paste</em></p>
<p>Then in insert mode you can paste as usual with Shift+Ins.</p>
<p>Edit: Caution! This disables mapping in insert mode and in command-line mode and abbreviations !!</p>
<p>So to disable it again type :set paste! or :set nopaste.</p>
<p>Another method and much faster is to type:</p>
<p>:a</p>
<p>paste the code and hit CTRL-C.</p>
<p>Hint: Hit enter before CTRL-C if you did not cut the last \n to not to miss the last line.</p>
<p>What annoys me too sometimes is the auto-commenting of vim, you can disable it with:</p>
<p>:set com=f://</p>
<p>But this only works when you type it in command mode. To set it permanently, you have to write this in your ~/.vimrc :</p>
<p>set fo-=r</p>Moving Files containing a specific string2006-12-25T00:00:00+01:002006-12-25T00:00:00+01:00streetyogitag:street.yoga,2006-12-25:/moving-files-containing-a-specific-string.html<p>sometimes commands are longer than the content itself</p><p>So far i found this solution to move files from current directory to a given one:<br>
<code>find . -type f -iname '*string*' -exec mv {} /dir \;</code> <br>
If someone knows something shorter, please let me know. </p>Administer logfiles2006-11-22T00:00:00+01:002006-11-22T00:00:00+01:00streetyogitag:street.yoga,2006-11-22:/administer-logfiles.html<p>a very short selection, line spacing for dramatization</p><p>I search for a solution to administer logfiles, so far my candidates:</p>
<p>swatch</p>
<p>logsurfer</p>
<p>logwatch</p>Filter configfiles from comments2006-11-17T00:00:00+01:002006-11-17T00:00:00+01:00streetyogitag:street.yoga,2006-11-17:/filter-configfiles-from-comments.html<p>no code, just comments</p><p>Somtimes you only want to see configuration in a config-file, to filter out every blank line and every comment line a simple:</p>
<pre>
egrep -v '^$|^#' something.conf
| | | | '-> a mesh at the beginning of line
| | | '-> or
| | '-> from start to end ... nothing -> blank line
| '-> do not show ... containing
'-> to match against regular expressions</pre>
<p>will do the work.</p>
<p>Edit:</p>
<p>Found another way:</p>
<p>grep ^[^#]</p>
<p>Also filters comments and blank lines (but no spaces and tabs).</p>weechat: disable infobar2006-11-10T00:00:00+01:002006-11-10T00:00:00+01:00streetyogitag:street.yoga,2006-11-10:/weechat-disable-infobar.html<p>I need more space</p><p>I use weechat inside screen alot, therefore its difficult to monitor it with ^A M because the clock in the infobar changes every second :)<br>
Because i have a infobar in wmii allready i disabled the one in weechat like this: </p>
<p><code>/set look_infobar = off</code></p>weechat: automatic identify to NickServ and BitlBee2006-11-07T00:00:00+01:002006-11-07T00:00:00+01:00streetyogitag:street.yoga,2006-11-07:/weechat-automatic-identify-to-nickserv-and-bitlbee.html<p>less typing, so I can type more</p><p>If you don't want to type on each start of weechat to identify yourself, do:</p>
<p><em>/set freenode.server_command="/msg NickServ identify PASSWORD"</em></p>
<p>Replace freenode with the server you want to connect of course if needed.</p>
<p>For automaticaly connect to the BitlBee-Server you have to type:</p>
<p><em>/set bitlbee.server_command="/msg &bitlbee identify PASSWORD"</em></p>Screen with Midnightcommander2006-11-06T00:00:00+01:002006-11-06T00:00:00+01:00streetyogitag:street.yoga,2006-11-06:/screen-with-midnightcommander.html<p>function keys, who needs them anyways</p><p>When you have problems with the function keys with mc on a screen session, just use ESC 1-10, or ESC 9 Options/Learn Keys and adjust it there.</p>Omni-completion (aka "Intelisense") in vim using tab-key2006-10-27T00:00:00+02:002006-10-27T00:00:00+02:00streetyogitag:street.yoga,2006-10-27:/omni-completion-aka-intelisense-in-vim-using-tab-key.html<p>vimscript is a scripting language, so it is possible to use vim to write scripts</p><p>Just add this fine piece of code to your ~/.vimrc:</p>
<pre>
function! CleverTab()
if pumvisible()
return "\"
endif
if strpart( getline('.'), 0, col('.')-1 ) =~ '^s*$'
return "\"
elseif exists('&omnifunc') && &omnifunc != ''
return "\"
else
return "\"
endif
endfunction
inoremap =CleverTab()</pre>
<pre></pre>
<p>Edit:
Found a site which describes quite well how to enable the built in omnicompletion using ^X^O <a href="http://amix.dk/blog/viewEntry/19021" title="omnicompletion in vim" target="_blank">here</a>.</p>
<p>^X^F completes filenames and directories.</p>
<p>Some other completion methods:</p>
<p><a href="http://blog.rosejn.net/articles/2006/02/28/snippetmagic-0-02" title="another textmate snippets in vim" target="_blank">SnippetMagic:</a></p>
<p>Works for my but the arrow keys are not correctly mapped so use better</p>
<p><a href="http://vim.sourceforge.net/scripts/script.php?script_id=1318" title="textmates snippets for vim" target="_blank">snippetsEmu:</a></p>
<p>witch worked out of the box for me, just create ~/.vim/after/ftplugin, open the vimball, source it with :so and use it with your tab-key.</p>GTD2006-10-22T00:00:00+02:002006-10-22T00:00:00+02:00streetyogitag:street.yoga,2006-10-22:/gtd.html<p>geting things not done by figuring out how to get them done</p><p>Today i discovered some nice tools to construct a terminal-based GTD-System for me:</p>
<p><strong><a href="http://www.roaringpenguin.com/penguin/openSourceProducts/remind" title="comand line reminder" target="_blank">remind</a> and the textbased frontend <a href="http://www.eecs.umich.edu/~pelzlpj/wyrd/" title="Frontend to remind" target="_blank">wyrd</a></strong></p>
<p>have to look at wyrd closer to find out how to make it transparent.</p>
<p><a href="http://www.vimoutliner.org" title="Outliner for vim" target="_blank"><strong>VimOutliner:</strong></a></p>
<p>emerge vimoutliner</p>
<p><a href="http://bike-nomad.com/vim/vimoutliner.html" title="The Vim Outliner" target="_blank"><strong>TVO: The Vim Outliner:</strong></a></p>
<p><strong><a href="http://footils.org/cms/show/59" title="Tagging scripts for mutt" target="_blank">GTD with mutt:</a></strong></p>
<p><strong><a href="http://footils.org/cms/show/59" title="Tagging scripts for mutt" target="_blank"></a></strong>
<strong><a href="http://shared.snapgrid.com/index.html" title="gtd-wiki in one html-file" target="_blank">GTDTiddlyWiki:</a></strong>
Ok, this one is not consolebased but in some sense also minimal, came across this several times, but overlooked that this is a simple html-file which stores everything in it. save it to an usb-stick, access it somewere else, only a webbrowser with javascript is needed. And as i discovered this absolutely ingenious firefox plugin named <a href="http://vimperator.mozdev.org/" title="vim-like firefox extension" target="_blank">vimperator</a> (simply said, a plugin which makes praktikaly vim of your firefox) i can use it very fast and without a mouse. Same goes for all Google stuff like gmail or reader.google.com. it integrates very well with the keybordshortcuts from google, just press the I-Key if there are conflicts or escape them with C-v.</p>Use vim instead of mcedit in midnight commander2006-10-22T00:00:00+02:002006-10-22T00:00:00+02:00streetyogitag:street.yoga,2006-10-22:/use-vim-instead-of-mcedit-in-midnight-commander.html<p>vim should be a plugin to everything</p><p>Man how long i searched for this shit</p>
<p>Under options/configuration unset "use internal edIt"</p>HowTo set the wallpaper in wmii2006-10-21T00:00:00+02:002006-10-21T00:00:00+02:00streetyogitag:street.yoga,2006-10-21:/howto-set-the-wallpaper-in-wmii.html<p>pretty</p><p>This took me a little bit, so i write it down.</p>
<p>In ~/.wmii-3.5/wmiirc, replace the following line:<em> </em></p>
<p><em><code>xsetroot -solid '#0b1014'</code>
</em>with a command to set the background image, such as<em> </em></p>
<p><em><code>eval <code>cat $HOME/.fehbg</code> &</code>
</em>(requires <a href="http://linuxbrit.co.uk/feh/"> feh</a>)</p>
<p>Now i don't have to bother anymore with the configfile,</p>
<p>feh --bg-center ~/path/to/image sets the backgroundimage</p>
<p>and after a reboot the last shown picture is set.</p>How to change default Soundcard under linux2006-10-20T00:00:00+02:002006-10-20T00:00:00+02:00streetyogitag:street.yoga,2006-10-20:/how-to-change-default-soundcard-under-linux.html<p>life without soundcards would be a mistake</p><p>First i find out the name of the card:
<em>cat /proc/asound/cards</em></p>
<p>gets me Audigy2.<em>
</em></p>
<p>Then i add this lines to my /etc/asound.conf</p>
<pre><code>
pcm.!default {
type hw
card Audigy2
}
ctl.!default {
type hw
card Audigy2
}</code></pre>Transparent Console-Programs For Linux I Use.2006-10-18T00:00:00+02:002006-10-18T00:00:00+02:00streetyogitag:street.yoga,2006-10-18:/transparent-console-programs-for-linux-i-use.html<p>my lifes work is invisible</p><p>So far my favorite transparent consoleprograms are:</p>
<p><a href="http://www.ibiblio.org/mc/" title="midnight commander" target="_blank"><b>midnight commander:</b></a></p>
<p>Just start it like this in a transparent terminal:</p>
<p>mc -b</p>
<p>Full credit goes to the ingenious <a href="http://tamihania.wordpress.com/" title="tamihania" target="_blank">tami</a>, she was kind enough to share this fabulous hint. Have a look at her site, she has also some very beautiful screenshots and more useful tips here: <a href="http://tamilinux.wordpress.com/2007/02/16/fvwm-crystal-feat-patagonie/" title="tamihania" target="_blank">http://tamilinux.wordpress.com/2007/02/16/fvwm-crystal-feat-patagonie/</a>
<strike></strike></p>
<p><b><a href="http://www.ninjam.com/" title="Ninjam" target="_blank">ninjam:</a></b></p>
<p>A realtime music collaboration software</p>
<p>edit cursesclient/cursesclient.cpp:</p>
<p>start_color();</p>
<p>use_default_colors(); <-- add this line after the existing start_color();</p>
<p>init_pair(1, COLOR_WHITE, COLOR_BLUE); // normal status lines</p>
<p><b><a href="http://www.jdkoftinoff.com/main/Free_Projects/Drum_Synth_For_Linux/" title="Drum Synth for the console" target="_blank">jdkdrum:</a> </b></p>
<p>A command-line drummachine, reads simple ascii-patterns from stdin. you can also start it in interactive mode.</p>
<p><a href="http://www.raggle.org/" title="Raggle " target="_blank"><b>raggle:</b></a></p>
<p>A console RSS aggregator, written in <a href="http://www.ruby-lang.org/">Ruby </a>. Oh yes, did i mention the vi-like navigation ? Then i do it now :)</p>
<p>in your ~/.raggle/config.rb</p>
<p>do a %s/Ncurses::COLOR_BLACK/-1/g</p>
<p>well almost, i swapped one palettepair from the defaultconfig, and now its nearly perfect :)</p>
<p>I also set 'browser' to firefox (i know, elinks should be here :)) so change that to your liking in my <a href="http://princ3.files.wordpress.com/2007/03/config.txt" target="_blank" id="file-link-50" title="Transparent Raggle"> config.rb</a> (change <em>.txt to </em>.rb)</p>
<p><b><a href="http://opensource.hld.ca/trac.cgi/wiki/CurseTheWeather" title="CurseTheWeather" target="_blank">CurseTheWeather:</a></b></p>
<p>We all love weather, don't we :)</p>
<p>Edit CurseTheWeather-0.3/ctw:</p>
<p>curses.start_color()
curses.use_default_colors() <-- Add this line, you almost know the trick :)
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLUE)</p>
<p><b><a href="http://thekonst.net/centericq/" title="Multiprotocolmessenger" target="_blank">centericq:</a> </b></p>
<p>i prefer bitlbee in cooperation with weechat now</p>
<p><a href="http://elinks.or.cz/" title="Terminal Browser" target="_blank"><b>elinks:</b></a></p>
<p>console-based browser, you can compile it with spidermonkeysupport, a JavaScript C library, so it is the only transparent textbrowser i know which supports googlemail for example :)</p>
<p>You can assign almost everything to any key. There is a special searchable keybinding manager to not get lost in the sheer infinite capabilities in the art of keybinding. Of course i modeled mine after vim :) There is also an exmode available, you have to compile it with --enable-exmode as the gentoo-ebuild does not provide this essential to survive feature, bugreport is underway :)</p>
<p>Some useful settings:</p>
<p>Document/Browsing/Forms/Confirm submission/0</p>
<p>Document/Browsing/Forms/Insert mode/0</p>
<p>Document/Browsing/Images/Display links to images w/o alt/0</p>
<p><a href="http://software.schmorp.de/pkg/rxvt-unicode.html" title="Unicode Terminal" target="_blank"><b>rxvt-unicode: </b></a></p>
<p>i start the daemon urxvtd and connect with the following command (i use wmii, transparency did not worked with the perl tabs to me and i dont really need tabs anymore thanks to the wounderful world of screen :)):</p>
<p><i>urxvtc -tr</i></p>
<p>See my hints for <a href="http://princ3.wordpress.com/2006/10/01/unicode-terminal-with-tabs-support/" title="Tabs and clickable urls in rxvt-unicode" target="_blank">tabs and clickable links</a>, but be warned, the tabs dont support transparency (wmii/dwm)...</p>
<p><a href="http://www.afterstep.org/aterm.php" title="Terminal capable of Transparency" target="_blank"><b>aterm:</b></a></p>
<p>No Unicode, thats why i use rxvt-unicode, but this is for sure the the lightest terminal with transparency supported.</p>
<p>Just start like:</p>
<p>aterm -tr</p>
<p>Or you can add aterm*transparent:true to your ~/.Xdefaults</p>
<p><a href="http://http://conky.sourceforge.net/" title="Systemmonitor" target="_blank"><b>conky:</b></a></p>
<p>Systemmonitor, audacious and mpd support, hm maybe i switch to mpd then :)</p>
<p><a href="http://htop.sourceforge.net/" title="Interactive Process Viewer" target="_blank"><b>htop:</b></a></p>
<p>interactive process viewer:</p>
<p>kill, nice, incremental search, strace and view processes as tree, show kernelthreads... you can setup meters as bar, text, graph or led, very impressive.</p>
<p><b><a href="http://gift.sourceforge.net/" title="p2p network" target="_blank">gift</a>/<a href="http://www.nongnu.org/giftcurs/" title="ncurses frontend to p2p" target="_blank">giFTcurs:</a></b></p>
<p>A OpenFT, Ares, FastTrack, Gnutella, Gnutella2 daemon/client</p>
<p><b><a href="http://mldonkey.sourceforge.net/Main_Page" title="p2p client" target="_blank">mldonkey</a>/<a href="http://nc110.sourceforge.net/" title="network swiss army knife" target="_blank">netcat:</a></b></p>
<p>A eDonkey, BitTorrent, Gnutella, Gnutella2, FastTrack, OpenFT daemon. I use it with netcat (ok, mostly with the webinterface, but this is all about minimalistic transparency :)). Netcatlink to the original, of course you can also use telnet, netcat6, gnu-netcat, socat, cryptcat, nmap-ncat, sbd, pncat... go search for the client to your liking :)</p>
<p><a href="http://www.museek-plus.org/" title="Soulseek Client" target="_blank"><b>museek+/mucous:</b></a></p>
<p>Soulseekdaemon/client, just start in a transparent terminal. Mucous is ncurses-based and so far one of the most complex ncurses-programs i have seen. right-clickable context menues, chat-room-list, clickable tabs, but of course you can operate this fine peace of software only with your keyboard.</p>
<p><a href="http://sourceforge.net/projects/nanodc" title="Ncurses-client for DC++" target="_blank"><span style="font-weight:bold;">nanodc:</span></a></p>
<p>an ncurses-based client to the DC++ network, it uses the DC++ client core and is therefore fully compatible.</p>
<p>For gentoo users, its in the sunrise overlay</p>
<p><a href="http://libtorrent.rakshasa.no" title="BitTorrent Client " target="_blank"><b>rtorrent:</b></a></p>
<p>Enter, tabcomplete to your torrentfile, cursor up to select the torrent, ^S to start downloading, thats it :)</p>
<p>Check this excellent <a href="http://kmandla.wordpress.com/2007/05/02/howto-use-rtorrent-like-a-pro/" title="rtorrent howto" target="_blank">tutorial</a>.</p>
<p><a href="http://www.vim.org/" title="Console Text Editor " target="_blank"><b>vim:</b></a></p>
<p>Well what can i write here, it's all about the keysteering, thats another goal of mine, to control my whole desktop vi-like. i already switch, move and resize windows like this (hail to <a href="http://www.suckless.org/wiki/dwm" title="Dynamic Window Manager" target="_blank">dwm</a>), scroll firefox hjkl-like <strike>with the <a href="http://mozilla.dorando.at/" title="Rebind your Keys" target="_blank">keyconfig-plugin</a> and this ingenious <a href="http://www.calmar.ws/firefox/" title="Vi-like keybindings for firefox" target="_blank">keybindings</a></strike> with <a href="http://vimperator.mozdev.org/" title="vim-like firefox extension" target="_blank">
</a></p>
<p style="font-size:15px;"><a href="http://vimperator.mozdev.org/" title="vim-like firefox extension" target="_blank">vimperator:</a> you like vim, you like firefox ? then this is a must have.</p>
<p>I would wipe out midnight commander if the <a href="http://vim.sourceforge.net/scripts/script.php?script_id=808" title="Total Comander like file exploring in vim" target="_blank">vimcomanderscript</a> wouldn’t be so damn slow, and <a href="http://vifm.sourceforge.net/" title="File Navigator, vi-keybindings !" target="_blank">vifm</a> does not have the comfort of mc and is also slower. I would almost die for vimlike keybindings in mc, so when someone has an appropriate solution, please give it to me. I don't mind to press the functionkeys and controlkeys, but grapping to the cursorkeys is a very big workflowkiller as i have to move my hand from the standard-typing position. As i work almost on a laptop, even small error corrections with my thumb on my mousepad, like moving floating windows for example, are not as bad as reaching the f... cursorkeys because my elbows stay almost always at the same place, but only one grab to the cursors and i have to move my whole right shoulder, elbow, arm and also hold it in the air, so my right arm is blocked for this time and i cannot fluidly switch tasks. Another present from god would be a pdf-reader with vi-like keybindings... but hey, people can fly, so maybe one day this will be possible too :)</p>
<p><b><a href="http://weechat.flashtux.org/" title="IRC-Client" target="_blank">weechat</a>/<a href="http://www.bitlbee.org/main.php/news.html" title="Multi-Protocol-Server/Client" target="_blank">bitlbee:</a></b></p>
<p>i use now bitlbee in favor of centericq:</p>
<pre>
/server bitlbee im.bitlbee.org 6667 -auto -nicks Nick1 Nick2 Nick3
register <passwd>
account add msn <account> <passwd>
account add oscar <account> <passwd> login.icq.com/login.oscar.aol.com
account add yahoo <account> <passwd>
account add jabber username@gmail.com <passwd> talk.google.com:5223:sslaccount on
identify <passwd>
set private false</pre>
<p>Now the explanation:
First i tell weechat to autoconnect to bitlbee when starting weechat, you get redirected to your bitlbee channel.
In this channel you register the nick you joined the bitlbee network (either Nick1, Nick2, or Nick3).
Then you add your accounts, for icq/aol choose the appropriate server.
Then you connect all accounts to bitlbee, after that the only thing you have to do when you start weechat is to type identify <passwd>.</p>
<p>With set private false you get all messages in the mainwindow, there type nick: to talk to somebody in your list.</p>
<p>Works like charm, serverside buddylists for all networks, no need to rename ID's to nicknames.
For further information type help in your bitlbee channel,
to clear the window type /cl.
Have to find out howto connect to the gadu gadu network, i guess i have to register to a jabber-server which has a gadu-gadu transport, but i don't know how for the moment.</p>
<p>some servers like testing.bitlbee.org have ssl-support through port 6668, just enter that port and type /set bitlbee.server_ssl = on</p>
<p><a href="http://wiki.xmms2.xmms.se/index.php/Main_Page" title="Mp3 Player Daemon" target="_blank"><b>xmms2:</b></a></p>
<p>Server/Client architecture, audioscrobbler/last.fm-plugin, written in ruby, is included.</p>
<p>millions of clients, but not one nice consoleclient :)</p>
<p>ok there is <a href="http://sirius.cine7.net/nyello/" title="pseudoshell frontend for xmms2" target="_blank">nyello</a>, as if i need another cli-client :) ok, have to be more tolerant here, lets see what the future shows.</p>
<p>So mpd and ncmpc move up closer and closer to me :) (If there would not be amarok, its grotoes slow but the comfort is capital and altough this is chill, after a few hours of play it is not more.)</p>
<p>One big plus of xmms2: .cue cuesheet support which mpd does not have.</p>
<p>maybe some day i find out how to ged rid of the black background of x2cp</p>
<p><b><a href="http://www.musicpd.org/" title="Music Player Daemon" target="_blank">mpd</a>/<a href="http://www.musicpd.org/ncmpc.shtml" title="ncurses client for mpd" target="_blank">ncmpc</a>/<a href="http://vidar.gimp.org/?page_id=50" title="Proxy for last.fm streams" target="_blank">lastfmproxy</a>/<a href="http://www.red-bean.com/~decklin/software/lastfmsubmitd/" title="scrobble with mpd" target="_blank">lastfmsubmitd</a>:</b></p>
<p>I think my search for an consolebased solution whith most of last.fm features is over:</p>
<p>layman -a mpd <-- for lastfmsubmitd/lastmp (tried mpdscribble, but it doesn't scrobbled last.fm-streams for me complaining that the song is too short)</p>
<p>layman -a zugaina <-- for lastfmproxy</p>
<p>So to have everything working you have to start all of this :</p>
<p>/etc/init.d/mpd start</p>
<p>/etc/init.d/lastfmproxy start</p>
<p>/etc/init.d/lastfmsubmitd start (in gentoo you have to do a chown lastfm /etc/lastfmsubmitd.conf)</p>
<p>/etc/init.d/lastmp</p>
<p>mpd --update-db updates your database</p>
<p>For playing streams in the m3u-format directly from the net i have this solution:</p>
<p>First create this script and make it executable (you need to emerge mpc for this to work):</p>
<blockquote> #!/bin/bash
mpc clear
cat $1 | mpc add
mpc play</blockquote>
<p>Then associate your browser to open all .m3u endings with this script.</p>
<p>More useful hints about mpd you can find <a href="http://pp.laemmy.net/MPD#titelanker10" title="mpd tips" target="_blank">here</a> (German only). Btw: i tend to use the mpc-client bundled with mpd</p>
<p><b><a href="http://rus.members.beeb.net/rexima.html" title="console mixer" target="_blank">rexima:</a></b></p>
<p>A simple Mixer for the console, cursesbased, most important: you can select channels with j+k and adjust volume with h+l :)</p>
<p><b><a href="http://triq.net/obex" title="bluetooth transfer" target="_blank">obexftp:</a></b></p>
<p>Transfer files from and to your cellphone via bluetooth</p>
<p>To receive files from your mobile simply start the server with:</p>
<p>obexftpd -c /tmp -b</p>
<p>Then add the OPUSH handler:</p>
<p><code>sdptool add --channel=10 OPUSH</code></p>
<p>If for some reason you can't connect with your mobile, delete this directory:</p>
<p>rm -r /var/lib/bluetooth</p>
<p>Now send your files from the menu of your mobile and you receive them in your tmp-directory</p>
<p><b><a href="http://www.roaringpenguin.com/penguin/open_source_remind.php" title="calendar for console" target="_blank">remind:</a></b></p>
<p>consolebased calendar, see <a href="http://princ3.wordpress.com/2006/10/22/gtd/" title="My GTD article" target="_blank">here</a>.</p>
<p><b><a href="http://www.arrakis.es/~rggi3/youtube-dl/" title="youtube commandline download" target="_blank">youtube-dl:</a></b></p>
<p>Well, not much to say here, download youtube videos from the command-line</p>
<p>emerge youtube-dl</p>
<p><b><a href="http://archmage.sourceforge.net" title="view chm files" target="_blank">archmage:</a></b></p>
<p>with this little handy program you can view *.chm files, it replaced completely xchm for me.</p>
<p>archmage -p 1234 some/interestingtext.chm</p>
<p>now connect with a textbrowser to port 1234, for example:</p>
<p>elinks http://localhost:1234</p>
<p>and voila, you can read *.chm files at the console.</p>
<p>For you gentooers out there, there is an ebuild at <a href="http://bugs.gentoo.org/show_bug.cgi?id=55892" title="archmage ebuild">bugs.gentoo.org</a></p>
<p><b><a href="http://alioth.debian.org/projects/surfraw/" title="commandline interface to WWW " target="_blank">surfraw:</a></b></p>
<p>search the web from the commandline, currently supports 72 searchengines, some examples:</p>
<p>sr leodict some_english_word_i_dont_understand</p>
<p>This opens leo.org in elinks (you can of course specify your favourite browser) and translates the word for me into the german language. Of course you can set your own language:</p>
<p>sr leodict -help</p>
<p>shows you all options for this! searchengine.</p>
<p>This is the best commandline-translating-solution i have, i made an alias leo="sr leodict" and mapped quiting elinks without confirmation to a lowercase q instead of the default uppercase one.</p>
<p>You can also search wikipedia, ebay, google, imdb, /. ...:</p>
<p>sr -elvi</p>
<p>shows you all available searchengines and webservices.</p>
<p><b><a href="http://www.linuxpowertop.org/" title="tool helping reduce powerconsuming software/settings" target="_blank">powertop:</a></b></p>
<p>reduce the consumption of power by following the suggestions for your computer</p>supercollider under linux2006-10-05T00:00:00+02:002006-10-05T00:00:00+02:00streetyogitag:street.yoga,2006-10-05:/supercollider-under-linux.html<p>there is a vimscript for that</p><p>Just compiled supercollider and get the error:</p>
<pre><em>sclang: error while loading shared libraries: libscsynth.so: cannot
</em><em> open shared object file: No such file or directory
</em></pre>
<p>my break from linux was too long, so i forgot to add /usr/local/lib to /etc/ld.so.conf and run ldconfig as root.</p>
<p>Found this supercollider interaction script for vim:</p>
<p><a href="http://www.neisis.net/~alex/scvim/" title="supercollider interaction for vim" target="_blank"> http://www.neisis.net/~alex/scvim/</a></p>xmms2: Could not connect to xmms2d: xmms2d is not running.2006-10-05T00:00:00+02:002006-10-05T00:00:00+02:00streetyogitag:street.yoga,2006-10-05:/xmms2-could-not-connect-to-xmms2d-xmms2d-is-not-running.html<p>client running away from daemon</p><p>I came around this error, it means that the daemon and the client don't run in the same directory.</p>
<p><font>xmms2d -i unix:///tmp/apantutarinte</font>
<font>export XMMS_PATH=unix:///tmp/apantutarinte xmms2 list</font></p>
<p>helps alot.</p>
<p>Edit: this is no more necessary with DrGonzo release.</p>Disable shift-backspace logout in XGL and enable AltGr2006-10-04T00:00:00+02:002006-10-04T00:00:00+02:00streetyogitag:street.yoga,2006-10-04:/disable-shift-backspace-logout-in-xgl-and-enable-altgr.html<p>so many fingers, so many keys</p><p>It drove me mad that i logged <font>always</font> out from <font>XGL</font> after pressing <font>accidentally</font> shift-backspace.</p>
<p>You have to type:</p>
<p><code>xmodmap -e "keycode 22 = BackSpace BackSpace" </code></p>
<p>after your Window Manager started (that would be beryl in my case).</p>
<p>And because my <font>AltGr</font> key <font>didn't</font> worked too i first looked at the <font>keycode</font> with <font>xev</font> which was 113.</p>
<p>Then a little <font>lookup</font> how the key is occupied:</p>
<p><code>xmodmap -pk</code></p>
<p>And <font>finally</font> to make the key work again:
<font>
<code>xmodmap -e 'keycode 113 = Mode_switch'</code></font></p>
<p>And because i am a lazy person and dont want to type that over and over again to load it on startup i put both in my ~/.Xmodmap file:</p>
<p><code>echo 'keycode 22 = BackSpace BackSpace' >> ~/.Xmodmap</code>
<code>echo 'keycode 113 = Mode_switch' >> ~/.Xmodmap</code></p>Adding users to new groups2006-10-01T00:00:00+02:002006-10-01T00:00:00+02:00streetyogitag:street.yoga,2006-10-01:/adding-users-to-new-groups.html<p>schizoalism, many users, many personalities</p><p>If you want to add an user to a new group without to specify the groups he is allready in, use:</p>
<p>gpasswd -a <user> <group>
Then to make the group available without logging out from X, as user you can type:</p>
<p>newgrp <group></p>Unicode terminal with tabs support, clickable url's2006-10-01T00:00:00+02:002006-10-01T00:00:00+02:00streetyogitag:street.yoga,2006-10-01:/unicode-terminal-with-tabs-support-clickable-urls.html<p>how many terminals are there? many</p><p>After some time of search i found rxvt-unicode.
With compiled in perl support you can start it with:</p>
<p><font>urxvt -pe tabbed</font></p>
<p>or add:</p>
<p><font>URxvt.perl-ext-common: default,tabbed </font></p>
<p>to your ~/.Xdefaults</p>
<p>^shift cursor-left or cursor-right switches tabs,
^shift cursor-down creates new tab.</p>
<p>To leftclick an url in the terminal and open it for example in elinks, add:</p>
<p>URxvt.urlLauncher: elinks
URxvt.matcher.button: 1</p>
<p>Then start with urxvt -pe matcher</p>
<p>or simply add:</p>
<p><font>URxvt.perl-ext-common: matcher</font></p>
<p>to your ~/.Xdefaults (you can combine it with the tabs entry).</p>
<p>More useful hints:</p>
<p>man urxvtperl</p>Arrays2006-09-18T00:00:00+02:002006-09-18T00:00:00+02:00streetyogitag:street.yoga,2006-09-18:/arrays.html<p>A short introduction to arrays</p><p>To shortcut this:</p>
<p>a = ['apple', 'banana', 'peaches']</p>
<p>i use this construct:</p>
<p>a = %w{ apple banana peaches }</p>The Object ARGF and his methods2006-09-18T00:00:00+02:002006-09-18T00:00:00+02:00streetyogitag:street.yoga,2006-09-18:/the-object-argf-and-his-methods.html<p>ruby, ruby, ruby, ah-ah-ah-ah-ah-ah</p><p>Today i worked my way through the pickaxe book and triped over this fine example:</p>
<p>There is mentioned that you can abbreviate</p>
<p>ARGF.each {|line| print line if line =~ /Ruby/ }</p>
<p>to something like:</p>
<p>print ARGF.grep(/Ruby/)</p>
<p>So i tried that out in irb and to my surprise the behavior was not the same, ARGF.grep did not print anything. Fortunately a nice guy on #ruby-lang gave me a nice explanation, which goes far beyond my expectations.
1.) Irb has stdin and therefore has weird behavior.
2.) grep collects all its results into an array so it won't return until the file (stdin) is closed.
3.) After hitting Ctr-D a possibly match gets printed.
4.) each prints immediately the result
5.) To have the same behavior from grep use:</p>
<p>ARGF.grep(/Ruby/) { |s| print s }</p>
<p>no intermediate array is then created, resp. it does create an array but with the results of the block rather than the strings.</p>
<p>Thanks goes to LoganCapaldo for this impressing explanation.</p>
<p>Some more differences between irb and script:</p>
<p>def foo</p>
<p>end</p>
<p>p Object.private_methods -> normaly foo is here included, not so in irb, as irb starts as public, so you have to type private to have the same behavior</p>Tab completion in irb2006-09-15T00:00:00+02:002006-09-15T00:00:00+02:00streetyogitag:street.yoga,2006-09-15:/tab-completion-in-irb.html<p>i don't want to type if i don't need to</p><p>Just want to memorize.
irb --readline -r irb/completion
Now i can tabcomplete methods. (But this disables Filecompletion)</p>
<p>To make it permanent add this to your .irbrc:</p>
<p>require 'irb/completion'</p>Mistakes in Agile Web Programming with Ruby on Rails2006-09-14T00:00:00+02:002006-09-14T00:00:00+02:00streetyogitag:street.yoga,2006-09-14:/Some mistakes I found so far in the first edition.html<p>to err is human</p><p>Enclosed are snippets from Agile Web Programming with Ruby on Rails.</p>
<p>File 65:</p>
<div class="highlight"><pre><span></span><code><span class="sr">%r{^http:.+\.(gif|jpg|png)$}i</span>
</code></pre></div>
<p>changed to </p>
<div class="highlight"><pre><span></span><code><span class="sr">%r{\.(gif|jpg|png)$}i</span>
</code></pre></div>
<p>Now i can save the pictures in the projects/images folder as suposed in the book and not somewhere at the internet.</p>
<p>File 67: </p>
<div class="highlight"><pre><span></span><code><span class="ss">:confirm</span><span class="w"> </span><span class="o">=></span><span class="w"> </span><span class="s2">"Are you sure?"</span><span class="w"> </span><span class="o">%></span>
</code></pre></div>
<p>changed to </p>
<div class="highlight"><pre><span></span><code><span class="ss">:confirm</span><span class="w"> </span><span class="o">=></span><span class="w"> </span><span class="s2">"Are you sure?"</span><span class="p">,</span><span class="w"> </span>
<span class="ss">:post</span><span class="w"> </span><span class="o">=></span><span class="w"> </span><span class="kp">true</span><span class="w"> </span><span class="o">%></span>
</code></pre></div>
<p>Now i can delete the products too.</p>