Author Archives: rom1dep

Migrating from autojump to fasd

fasd is an autojump clone with some nice extra goodies.

In case you don’t know either (let aside any of their many variants, like z, v, …), they all are shell hooks that learn from your filesystem browsing habits, by keeping a database of the paths you access with cd along with their frequency of visit.

This data comes particularly handy when used together with a (generally single letter) command that lets you fuzzy match against a path name, guess the most likely occurence, and send you automatically to it.

For instance, a lengthy cd ~/Developments/MyFavoriteLang/TheProjectType/MyHotProject can often be replaced by j d mhp which is arguably a huge keystroke, time and mind saver. One really has to try it to seize the full benefit.

Anyway, most of the value of such a tool boils down to the completeness and relevance of the underlying paths database, which makes switching from a tool to the alternative very tedious and counter-productive. Hopefully the file format is so simple that in case of a transition from autojump to fasd, it’s as simple as running the following:

cat ~/.local/share/autojump/autojump.txt | pyle -e "words[1]+'|'+words[0]+'|'+str("$(date +%s)")" > ~/.fasd

As to the reasons that pushed me towards fasd, well, the main one is that it also remember files (on top of directories), so it’s possible to use it to invoke vim or xdg-open on recent or frequently accessed files.

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

vmware on fedora 24 wih kernel 4.8

This is what seems to be the third post of a series of fixes for getting vmware to work on fedora:
Previous posts:
vmware on fedora 24 with kernel 4.7
vmware on fedora 24 with kernel 4.6

The following should make it possible to use vmware on the kernel on version 4.8:

vim /usr/lib/vmware/modules/source/vmmon.tar → vmmon-only/linux/hostif.c
(vim) :%s/NR_ANON_PAGES/NR_ANON_MAPPED/g
Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

vmware on fedora 24 wih kernel 4.7

This is what seems to be the second post of a series of fixes for getting vmware to work on fedora:
Previous post: vmware on fedora 24 with kernel 4.6

The following should make it possible to use vmware on the kernel on version 4.7:

vim /usr/lib/vmware/modules/source/vmnet.tar → vmnet-only/netif.c
(vim) :%s/dev->trans_start = jiffies/netif_trans_update(dev)/g
Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

Use a Let’s Encrypt certificate with ejabberd

If you want to use a custom certificate on your ejabberd instance, here is how to make it in a way which is understandable by your server.

Ejabberd requires the key, the certificate, and the chain all together in a single file (in this order).
So, if you are obtaining your certificate from let’s encrypt, you can simply:

cd /etc/letsencrypt/live/<the domain>
cat privkey.pem fullchain.pem > server.pem
chown ejabberd server.pem && cp server.pem <ejabberd certificate location>
Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

vmware on fedora 24 with kernel 4.6

With the new kernel 4.6 found in fedrora 24, you will need to patch two modules for vmware to work again:

/usr/lib/vmware/modules/source/vmmon.tar → vmmon-only/linux/hostif.c
/usr/lib/vmware/modules/source/vmnet.tar → vmnet-only/userif.c

and replace any occurence of “get_user_pages” by “get_user_pages_remote” in these two files.

This comes particularly handy with vim where it’s only a matter of typing :%s/get_user_pages/get_user_pages_remote/g in hostif.c and userif.c . A nice feature of vim (that not everyone is aware of) is that it lets you browse zipped archives and edit the files it contains as if they were plain, uncompressed files.

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

Create a rhodecode gist directly from CLI

With your rhodecode installation comes a nice gist tool that allows you to share and edit code snippets (just like the well known gist from github). Less known but very very handy is its client-side counterpart, aka the rhodecode-gist command that allows you to pipe the output of any shell script directly into a new gist, easing things like:
cat myscript.py|rhodecode-gist --private
for quick sharing, or
$buggy_command|rhodecode-gist
for sharing a trace with developers.

Installing rhodecode-gist

Sadly, rhodecode-gist is bundled with rhodecode-tools that isn’t (yet) available on pypi. Instead you’ll have to fetch it from the official website:
pip install https://code.rhodecode.com/rhodecode-tools/archive/stable.zip

Configuring rhodecode-gist

Server-side

You need to generate an API Key, just login to your rhodecode account, User → My account → API keys
Copy the new API Key.

Client-side

Simply run
rhodecode-gist --apikey={above key} --apihost=http://{url to your RC installation} --save-config

And that’s all, now you can use the above commands! As optional parameters, you can also specify the gist visibility (public/private), set a filename/description and specify the lifetime, the command should return a json string containing your brand new gist URL.

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

Dogecoin Tips

Hi all!
I just enabled a plugin allowing easy donations using the (many wow) dogecoin crypto currency,
if you wanna tip me for the content of this blog, feel free to give away your such awesome DOGEs at DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c !

Dogecoin-NASA

to the moon

Very Thanks!

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

Fedora 20, How I got by my RPM breakage of the day

It’s not that common that RPM breaks its database, but it already happened to me twice since f20 released.

Last time, and because I was in a hurry, I finished by simply reinstalling my system, but today I think I got through enough WTF to post something about it.

It started with the usual message of a yum no longer able to install anything, and a notice about corruption and the advise of rebuilding the package database.

That’s what I did, with rpm --rebuilddb but that lead to a brand new error message… so was my first time it broke that bad. rpmdb --rebuilddb didn’t do any better so I finished with this very old (and bad) advise which consists of removing the databases files themselves. After that, the above –rebuilddb commands worked well, but:

  • Yum was by then unable to connect to any mirror, because it was unable to parse the $releasever tag for its queries,
  • yum check was reporting about 2500 packages with missing dependencies (!!!)

I found the first issue very irritating, because despite of the database problem that was finally gone, I was now hit by a bug from nowhere preventing me from fetching the packages I could require for fixing my stuff…
But hopefully this can be worked around by passing the –releasever=20 parameter to any yum command.

So now, what do when yum puts $releasever in the URLs of the mirrors it tries to connect with? Simply install the fedora-release package that provides the missing redhat-release.

But this sadly doesn’t fix the 2500+ “has missing requires” errors returned by yum check. Before moving away the rpmdb files, I did a rpm -qa > pkglist.txt just inc case… So what about a yum $(cat pkglist.txt) then? Sadly it didn’t work, with yum answering all packages are already installed… (Hu! ô.O) So I ended with the above snippet (source):

yum check dependencies \
| grep 'has missing requires' \
| sed 's/.\+has missing requires of //' \
| sed 's/ [=<>].\+//' \
| while read dep; do yum -y install "$dep"; done

This will run yum install as many times as there is a missing dep, so it will literally kill your yum history and very likely run much more commands than required. I’d rather suggest a:

yum check dependencies \
| grep 'has missing requires' \
| sed 's/.\+has missing requires of //' \
| sed 's/ [=<>].\+//' > yumrescue.list

in combination with a yum install $(cat yumrescue.list)

Hope it helps.

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

rom1dep

October 2, 2013

Hi, I just did some server-wide tweaks regarding cache management and php config, loading times should be way faster now.

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?

Major update

Hi !

today wasn’t an easy sysadmin day : I switched host, moved from a virtual private server at ikoula to a dedicated one at OVH, I migrated all my services (finally !), and made a complete rewrite of all the apache config in order to handle more efficiently multiple DNs since I’m going to share this server.
That’s why this blog looks so shiny white, the new default wordpress theme isn’t that bad 🙂 , and I might well keep it as a basis for further typo-tuning.

See you around !

Donate Dogecoins: DJi4fgSMxcq5vRjytvCEq9A1TVsDZevd7c Whats This?