Snippy – Linux Text Expander for KDE and Mint

Today I published this to my Github: https://github.com/christopherowenowens/snippy

In 2015 I was working as the single point of contact for a company’s support email queue, and had many common questions which could be answered with a ‘canned reply’. Instead of copy-pasting from an existing file – taking time to CTRL+F or open different files, copy-tab-paste – I wanted something I could manually trigger from the keyboard in as few strokes as possible.

Fast forward to 2019 when I switched to KDE as my desktop environment, and the previous script I had didn’t work out of the box again. So; an hour of tinkering and here we are with a KDE text expander.

I plan on cleaning this up greatly, maybe adding help / man files, a way to easily add snippets (via a context menu instead of manual file creation), and to include this as part of my forthcoming CLI Tools package. Maybe an easy ‘install’ script (checking for prerequisites, setting up custom keyboard shortcut etc.)

Kill Dash Nine

Reaching into the wayback machine for this one!

You can download the MP3 from the official site, or by searching for it on streaming services.

Lyrics

I guess I’ll have to shut you down for good this time,
Already tried a SIGQUIT, so now it’s KILL DASH 9.
You gotta learn when it’s time for your thread to yield;
It shoulda slept; instead you stepped and now your fate is sealed.
I’ll take your process off the run queue without even asking
‘Cause my flow is like reentrant and preemptive multitasking.
Your sad rhymes are spinnin’ like you’re in a deadlock,
You’re like a synchronous sock that don’t know when to block;
So I pull out my keyboard and I pull out my glock,
And I dismount your girl and I mount /proc
And I’ve got your fuckin pid and the bottom line
Is that you best not front or else it’s KILL DASH NINE.

KILL DASH NINE,
No more CPU time.
I run KILL DASH NINE,
And your process is mine.
I run KILL DASH NINE,
‘Cause it’s MY time to shine
So don’t step outta line or else it’s
KILL DASH NINE!

See it ain’t about the Benjamins or Pentiums or Athlons,
But you rappin’ 50 meters while I’m spittin’ in decathlons.
Your shit’s old and busted, mine’s the new hotness;
You’re like CLR and I’m like CLRS.
You’re running csh and my shell is bash,
You’re the tertiary storage; I’m the L1 cache.
I’m a web crawling spider; you an Internet mosquito;
You thought the 7-layer model referred to a burrito.
You’re a dialup connection; I’m a gigabit LAN.
I last a mythical man-month; you a one-minute man.
It’s like I’m running Thunderbird and you’re still stuck with Pine,
Which is why I think it’s time for me to KILL DASH NINE.

Yeah it’s KILL DASH NINE
No more CPU time.
‘Cause it’s KILL DASH NINE,
And your process is mine.
I said KILL DASH NINE
‘Cause it’s my time to shine,
So don’t step outta line or else it’s
KILL DASH NINE!

My posse throws down like leaky bucket regulators;
I was coding shit in MIPS while you were playing Space Invaders.
With my finger on the trigger I run ./configure
Yo, this package is big, but MY package is bigger.
I roll my weed with Zig Zag while I zag-zig splay,
And I do a bounds check before I write to an array.
I’m a loc’d out baller writing KLOCS a day,
‘Cause it’s publish or perish, fool, what can I say?
I’m 26 now, will I live to see 28?
Some days I wonder if I’ll survive to graduate.
But hey, that’s just fine, I won’t ever resign,
And if fools try to step then it’s KILL DASH NINE!

Yeah it’s KILL DASH NINE,
From my command line
It’s KILL DASH NINE
Sending chills down your spine,
I said KILL DASH NINE,
‘Cause it’s my time to shine,
So don’t step outta line or else it’s
KILL DASH NINE!

fs sa rlidwka
I’ll chown your home and take your access away
Comin’ straight outta Stanford, ain’t nobody tougher,
Control-X, Control-C, I’ll discard your fuckin’ buffer.
You’re outside your scope, son, close them curly brackets,
‘Cause I drop punk-ass bitches like a modem drops packets.
Dump your motherfucking core, and trace your stack
‘Cause where your ass is going, there won’t be no callback.
See my style is divine and my code is sublime,
My career’s in a climb and yours is in a decline.
I’ll write a pound-define and assign you as mine,
So refine those sad rhymes or remove your plus signs,

Or it’s KILL DASH NINE,
No more CPU time,
‘Cause it’s KILL DASH NINE,
And your process is mine,
I said KILL DASH NINE
‘Cause it’s my time to shine,
Bitch you stepped outta line and now it’s
KILL DASH NINE!

IoT sploit: Bird Scooters

You know those rental scooters which litter the sidewalks everywhere you go now? The App Analyst has a fascinating writeup regarding Bird scooters and the minimal security measures taken.

While I was in Prague this summer, these were a favorite for tourists to use, since the Old Town was just large enough that walking took some time, but not worth renting a car or bike. But little do drunk college kids know that riding these on cobblestones (thud-thud-thud-thud) isn’t much fun!

Looks like Bird does leverage CloudFlare to help with VPN stuff, but they don’t have other protections against location spoofing (such as requiring both GPS and WiFi access), nor do they use certificate pinning.

Although not mentioned in the article, exposing access to the internal / restricted API without any sort of authentication is another boo-boo.

Need help setting up a secure RESTful API? Get in touch.

Bypassing the QR code doesn’t just allow for ‘remote registration’ but can be used to DoS; and the damning bit regarding the Nokelock details being included should definitely be removed.

This is just one example of the burgeoning IoT security landscape which will dominate the internet through the 2020s. I can help; just drop me a line!

WordPress Permalink Structure

WordPress has become my favorite CMS, due to it’s ease of use for non-technical people (versus Drupal and OctoberCMS, which target gearheads). This makes it a no-brainer as a platform for quick prototyping, as well as allowing normal people to manage and update their websites.

I find the default Permalink structure (categories, dates, etc) to be ugly as sin. I prefer to modify this to just have %hostname% / %post-name% /.

Need help with your WordPress site? I’ve been doing customization and PHP work for 10 years. Just send me an email at owen@in-tuned.com and I’m happy to help!

However, when you change that setting, I was getting an error with 404 URL not found. Weird. A little looking around and I realize that it was using the Apache mod_rewrite to handle this. As such, there were two steps:

  1. Setting the .htaccess directives
  2. Setting the httpd.conf directive for AllowOverride

The .htaccess was a no-brainer; heck, WordPress prints it to the page and tells you to copy it (since your .htaccess should NOT be editable to www-data nor public, but owned by root).

But even with the correct rewrite rules, it wasn’t working. It’s because of the second step – there’s another directive to allow your Apache configuration to actually executive the rewrite. This lives under a <Directory> setting as an AllowOverride directive.

See this stack overflow where this is discussed in depth, including the correct “minimum permissions” model. (Don’t AllowOverride all!)

Tired of problems with Wix and Squarespace? I can create a fully customized website for your business within a couple of hours! Just email me at owen@in-tuned.com.

So the first few times I did this, no problem. Until I set up this blog, where it wasn’t working again. I know my httpd.conf is correct, and so I copied my .htaccess from an existing site. Still no go, but I was getting a weirder error — “index.php not found” even though the permalink should be https://ratm.io/blog/github-is-live/. Weird.

So I just ran a quick diff against what I had versus what WordPress indicated it should be — doh! The “/blog/” slug was the difference. I updated that and voila, permalinks that work.