Showing posts with label 24. Show all posts
Showing posts with label 24. Show all posts

Friday, February 5, 2016

Everything I learned in the past 24 hours about linux 1454703438

Convert all m4a files into mp3's in a directory:

IFS=$(echo -en "\n\b");for i in *.m4a; do name=`echo $i | cut -d'.' -f1`; echo $name; ffmpeg -i $i $name.mp3;   done


@nayafia at medium.com has been blogging about open source infrastructure projects and the posts so far have been interesting.

I added these to my .bashrc:
alias volumedown='amixer -D pulse sset Master 5%-'
alias volumeup='amixer -D pulse sset Master 5%+'

For reducing and increasing the volume.

Tuesday, February 2, 2016

Everything I've learned about linux in the last 24 hours, 1454460884

Mostly I've been playing around with cacalabs stuff, which is awesome. Mostly I've been playing with neercs, which has screen like controls and allows for compiz style terminal windows. Cause you know it, I know it, and everybody knows it...the terminal needs more 3d.

Also check out the license page. WTFPL

No one liners or regexes for today.

Everything I learned about linux in the last, I don't know 64 hours? 1454425611

I try to make these things 24 hours, but I'm relocating to another state, and goodbyes had to be said. And packing and then thins that have to do with that and whatever. Anyways, let's talk about Regex:

I love regex. I once regexed a regex to prove a point. I don't know why but this sort of pattern matching is a puzzle I enjoy. Regex is one of the few things I like helping out with. Regex Crossword is one of my favorite things. I use them more than I should and it probably gets me in trouble. Notably there are many reasons you shouldn't use regex. As JWZ said (sort of but not really):

Some people, when confronted with a problem, think
“I know, I'll use regular expressions.”   Now they have two problems.


One problem in particular is parsing xhtml. This particular stack overflow post about it is hilarious.

Another problem with regex is performance, particularly in the case of "catastrophic backtracking". That occurs, usually when you have multiple groupings, and there isn't a match. Because of the order of operations of the regex, it becomes computationally expensive.

If you want to know more about catastrophic backtracking, and preventing it with atomic grouping,   regular-expressions.info has a good write up. The regex buddy tool is an excellent way to debug regexes as well.

LibrePlanet in March will have Edward Snowden as a guest.


There is an upcoming Hack the Left hackathon. Hackathon's are getting interesting as there may now be pro hackathoners

I don't have a one liner or regex of the day today, sorry.

Sunday, January 31, 2016

Everything I learned about linux in 60 hours, 1454226440

In the last everything in 24/today post I didn't post anything on getting commands into the actual vim file you are editing. Whell for that you can use :read, so for the date something like:

:read !date


Sun Jan 31 01:49:15 CST 2016

Like so.

I've been busy with packing for the move, and working on some weird software stuff I can't really talk about just yet and smashing against a few API's so none of the good stuff in this post, just more dates like, if you don't want to use my(everyone's) perl one:

perl -e "print(time());"

You can always use the command line:

date +%s

I actually do a lot of stuff with time. And I have an argument and a some awesome knowledge on why Unix Epoch Time is the best time system ever... As well as things about Leap Seconds...Oh dear the things I could talk about   leap seconds.

But what's the big haps your going to see besides some of that stuff. Well I found the Second Edition of Kernighan and Ritchie's C book...so oh my do you have some Classic  C stuff.

But OH DUSTY, WHY NOT C++. Go read jwz's wikipedia page, cause we agree on that wholeheartedly. Not that jwz actually knows me...

WE ARE NOT WORTHY
WE ARE NOT WORTHY
WE ARE NOT WORTHY


I had someone dis me for using perl today, all bragging about javascript and node, and I was like you don't understand I like node, and this conversation happened.


Facebook tier is the two words cut off at the bottom


Anyway for our one liner today I am tempted to talk about httpie, which is a python utility/module that makes everything easier. Sure curl is great, and you should know curl, cause it's classic and it's basic and it's         ubiqutious. But damn if httpie isn't a little sexier with a brighter syntax.


So let's pie this bitch:

http --verify no GET https://mechanicalpinata.com/bullshit X-Auth-Token:shittoken content-type:application/json
~                                                                            


So that's GETting mechanicalpinata.com/bullshit, with a header of content type and an X-Auth-Token, if you are already super comfortable with curl, no worries and skip on. But otherwise, learn commit and do.


Thursday, January 28, 2016

Everything I learned about linux in the last 24 hours 1454016575

Let's start with this guy who automated the shit out of his job. Including built in hangover excuses, and smsing his wife he wasn't going to be home on time. As well as automating an entire customer workflow.

 Today I was doing stuff in vim and needed to use the command line, which you can do  with
:!command

so for the date:

:!date

And for my one liner of the day:

If you want to create a new buffer with the output of a command, like whenever I start the draft "Everything I learned about linux in the last 24 hours" posts, I start a new post like this:

:new `perl -e \"print(time());\"`

Tuesday, January 26, 2016

Everything I learned about linux in the last 24 hours 1453852288

Mostly I just learned how to paste into urxvt. Which sounds like nothing, and I guess it is but I like how much I can customize it, so suck it. I put this into my .Xresources file:


URxvt.perl-ext-common: default,clipboard
URxvt.iso14755: False
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.clipboard.copycmd:  xsel -ib
URxvt.clipboard.pastecmd: xsel -ob



And I added this script, to my .urxvt/ext/ folder as the global folder didn't work, which means somethings still funky because as far as I know both my users still have the same script, and one can't copy, so I'll probably work that out tomorrow.

As for the one liner of the day:

Some days when you can't work the configs out you just want to command line it to know that your doing something right, so for a gray background /true transparency urxvt window just:

urxct -depth 32 -bg rgba:3f00/3f00/3f00/dddd


I know today was oddly specific but, it's because I didn't have a lot of linux time today. I took an offer with a company today and spent a bit of it filling out paper work. So that's good.

Sunday, January 24, 2016

What I learned about linux in the last 24 hours 1453611250

This keyboard exists and I don't have it add, two sins to the tally.

This is all I got today. normally I hit the linux forums hard and try to learn a bunch, hell my goals on a given week are learn 8 things about linux and 3 things about vim. But today I just drank beer and watched football with my dad...so that's rare but it happened. Happy Sunday. See you tomorrow.

Friday, January 22, 2016

Everything I learned about linux today 1453518423


I'm going to try and do a daily, update on everything I learn about linux the day of. I don't know how long I will do this, or if it will continue after I start working a regular job again. Today I watched "Linux Sucks" the 2016 one that happened on Thursday the 21st:

    January 2016     

Su Mo Tu We Th Fr Sa 

                1  2 

 3  4  5  6  7  8  9 

10 11 12 13 14 15 16 

17 18 19 20 21 22 23 

24 25 26 27 28 29 30 

31 



I was excited to watch it so I had been hoping the link would show in one of my feeds, and eventually it did. I knew Lunduke was going to talk about systemd, and I was pretty sure what his opinion would be, and I was write. I'm not going to tell it to you, you should watch it. If your reading this after Friday you are probably better of checking lunduke's channel, because I imagine he will have a higher quality version posted.

My primary complaint with systemd is that it feels very much at odds with the unix way. The core tenants being:


(i) Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.
(ii) Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
(iii) Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them.
(iv) Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.
Or summed down to a one liner, perl style:
Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
Systemd is a monolithic program that does many things. It also stores logs in binary, not plain text. So no I don't prefer it, but I can't say I really love what Mac did with launchd. And in fairness systemd improves boot times in comparison to init. 



I have other gripes with it as well, but I haven't decided if they're unfounded or not. Lennart in general does not particularly ascribe to the linux or posix rules.

So that said does this make him a bad guy, or systemd bad. It doesn't. I do really want devuan to be successful and I would really love to see a yum or dnf package managed system take it's lead. But systemd is assuredly great at speeding up boot times, and it may be great at the many other things it does as well.

Clearly that's just a rant I had in my head for a long time, not something I learned today but whatever.

Your daily one liner or regex:

I started with this, it was just because I was mad because I left the slash off a regex and wanted to prove to the smart ass that pointed it out, that I know my shit and stfu.
A vim regex:
%s/s\/potatoe\/potato/s\/potatoe\/potato\//g

then /u/EnTantoEnCuanto

:%s|toe|to/|g

And then my friend from IRC and /u/xurdm:

:%s|$|/|g