Categories
Real languages

Real languages evolution: Are we in the road to create a programmers language?

Featured image took shamelessly from https://imgs.xkcd.com/comics/linguists.png feel free to read some of his kind comics.

After reading a post talking about the English segmentation between geographical parts of the Earth I came to think about what other kind of barriers could exists which could allow English to evolve independently and I thought professions and digital communities could be this barrier.

Let’s think about it a great amount of today programmers and system administrators are not native english speakers and many of them write English conveying the way of writting they saw in documentation which may not have been written by a native English speaker, the result is mutations of common English would be not so rare to be created and extended between the informatics community in a daily basics.

It is not uncommon to hear about someone who heard a conversation between two programmers and could not understand a single word because not having the abstract vocabulary we use.

There are more examples I can think about my hypotesis like the Bussiness English based on giving confidence about your products and organizations or the Gamers English plaged by acronyms like wtf, lol, gg, gges, etc.

Also a special technical english is teached for students of many fields like biology as a teacher of me during the ESO explained to me.

When are we going to found ourselves saying “This is not Latin anymore”?

Categories
wordpress

This is a WordPress with the default theme.

You are looking a WordPress blog with the twenty twenty theme that comes by default with WordPress with the colors personalized using the WordPress own graphical interface.

I think it looks pretty cool anyway, when I started doing this blog I thought I would made my own theme, but I didn’t have the need to do so since the WordPress personalization allowed me to make the blog look good for what I wanted to say.

This blog does not represent any brand, so it does not have to have a custom logo, header, footer or whatever a bussiness blog has to look like so the development of a brand new theme is in my opinion overkill and a waste of resources to write three or two not monetized articles in a week.

The true is always I wanted to do a blog for me always I choosed the default themes for these reason, I know how to do WordPress Theme development, but it always seems overkill to do it for my own blog.

If someday I find the current theme is not enough for something, I will attempt to write my own theme or extend the current one, but by the moment is what I need and more.

I want to hear your opinion. Do you think this theme looks good?

Categories
Golang regex

Golang Programming Language. Reading files to get deeper.

I am going to drop a snippet to introduce some cool concepts about the Golang Programming Language that may help you to see its coolness and maybe adopt it by yourself.

I am going to use regex, buffered IO, defered close, and handle errors for all of this in less than 60 lines with comments.

Comments may guide you, but any question can be answered to me about this code. Duckduckgo may also help you if you are not into doing that social thing.

package main

// Not say the import syntax is not cool.
import (
        "bufio"
        "fmt"
        "os"
        "regexp"
)

func main() {
        // The path to the file.
        path := "hola"
        // Opening the file.
        buffer, err := os.Open(path)
        // Error handling.
        if err != nil {
                dief("Unable to open file %s: %s", path, err.Error())
        }
        // We make this function execute on function return, expected or unexpected.
        defer func() {
                // Closing the buffer.
                err = buffer.Close()
                if err != nil {
                        dief("Unable to close buffer: %s", err.Error())
                }
        }()
        // Regexes are a useful tool to introduce.
        re, err := regexp.Compile("hola.")
        if err != nil {
                dief("Regexp failed to compile, malformed regex: %s", err.Error())
        }

        scanner := bufio.NewScanner(buffer)
        line_number := 1
        // Conditional for loop, works like while in other languages.
        for scanner.Scan() {
                this_line := scanner.Text()
                // In multiline arguments , is required also for the last argument.
                // The compiler expects , or ) not newline. :)
                fmt.Printf(
                        "Found hola %d times in line %d of %s\n",
                        len(re.FindAllString(this_line, -1)),
                        line_number,
                        path,
                )
        }
}

// Variadic arguments to a die helper function.
func dief(format_string string, args ...interface{}) {
        // We can pass variadic arguments to other functions which is pretty useful sometimes.
        fmt.Fprintf(os.Stderr, format_string+"\n", args...)
        os.Exit(1)
}

Here is some example content for the hola file we are reading.

holae huteoauhshthola hola ete hola
hola 
hola
holatttthola

And its example output, may differ since I left trailing whitespace sometimes in the file on purpose, but clipboard and WordPress may have omited it.

Found hola 3 times in line 1 of hola
Found hola 1 times in line 1 of hola
Found hola 0 times in line 1 of hola
Found hola 1 times in line 1 of hola
Categories
Golang

The Golang Programming Language. Introduction.

Since a few months I have been pretty hyped by the Golang Programming language since it provides much of the advantages in fast development of interpreted languages, say PHP, Javascript or Perl like tons of libraries for every job and advantages typical from a compiled language like a powerful type system and being blazing fast.

But how does the code in Golang look? This is what this blog post is about.

The first program we will like do is of course a simple hello world let’s do it:

mkdir helloworld
cd helloworld
go mod init helloworld

That will generate a go.mod file suitable for our needs, now we are going to code the hello world program into the file main.go in the folder we just did cd into:

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello world")
}

Now that we have the code and the go.mod file compiling will give us a executable with the name we passed into go mod init, let’s try it.

go build && ./helloworld

Hello world should have been printed into your terminal.

Congratulations, you just made your first program in Go, now let’s try moving it into a web.

Golang gives us bundled into the language the net/http library which allows web development in a way very similar to the Perl’s Mojolicious.

This code will spin a web server listening into the port 8080 which prints hello world when visited.

package main

import (
    "fmt"
    "net/http"
)

func main() {
    http.HandleFunc("/", helloWorldHandler)
    http.ListenAndServe(":8080", nil)
}

func helloWorldHandler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintln(w, "Hello world")
}

As you may figured out Golang is a very powerful language for web development, not only routing is easy thanks to net/http, but also features tons of useful libraries you may use to extend your program.

I recommend if you are interested on further expand your knowledge of this language take a look at https://golang.org/doc/tutorial/ and of course write some code using this language to test its capabilities.

Categories
blog wordpress

Blogs against a post in social media.

When I needed to explain complex concepts about free software and programming I choose to do it with WordPress instead of using the Linkedin or Pleroma mechanisms there is why:

  • A blog has no limit about the number of characters may be used allowing to explain your toughts in a more complete way.
  • When reading a post in a blog if you like it you can also read more content of the blog easily rather than looking into the user activity and getting the real content mixed with random shares and like.
  • Blog post may be shared in multiple social networks, at the prize of getting almost half visibility in for example Linkedin.
  • Your content belongs you, not a third party platform if you are the owner of your blog, you may move your content, edit it or promote it the way you want.

Starting blogging is easy, configuring a blog with WordPress is a 5 minutes process and if you cannot do it by yourself there are solutions like wordpress.com which may help you to get started.

What are you waiting to start blogging too?

Categories
Screen Vim

(Almost) All you need to use Vim and GNU Screen daily for coding.

First I am going to left my minimalist .vimrc:

set expandtab tabstop=4 shiftwidth=4
; tab = 4 spaces
map <C-a> ma:%!perltidy<CR>`a
; To autoformat perl with Control + a
set timeoutlen=0
; So O takes less time to open a new line.
set wildmode=longest:full,list
; To have the menu completion similar to the bash/readline one.

And my .screenrc:

hardstatus alwayslastline
hardstatus string '%{= kg}[ %{r}%H %{g}][%+17= %{= kw}%?%-Lw%?%{+b m}(%{W}%n*%f %t%?(%u)%50>%?%{m})%{-b w}%?%+Lw%?%?%= %{g}%-21=][%{c} %D %M %d %{r}%c %{g}]'
screen calcurse
title calendar
screen bash
title development
screen bash
title testing

select 0
bind ^\ quit

This lines are pretty useful in the .bashrc in a GNU screen and Vim development environment:

set -o vi
perl -e 'exit 1 if `pidof screen` || `screen -ls` !~ /No Sockets found in/; exit !($ENV{TERM} = /xterm/)' && exec screen

Now once you restart your terminal if have installed calcurse, perl and screen you should be drop into calcurse where you can take note of events you should attend.

To go to the next window you can use C-a n. Voila, you are in a terminal.

With C-a [ you should enter into the GNU screen copy mode which will be very useful if you run long commands to be able to navigate by the output and of course copy content from it using vim like key bindings.

There is a main difference, in screen to yank you use enter or C-m.

To copy the content from the clipboard you use C-a ].

In copy mode you can go a Page up with C-b and a page down with C-f and a line up with k, a line down with j, right with l and left with h.

With / you may do a forward search with regex and with ? you may do a backwards search.

You can also go a word right with e and a complete word right with E and a word left with b and a complete word left with B.

You can jump to the start of the line with ^ and to the end with $.

If you know a little of vim this keybindings will be very familiar to you since are the ones Vim uses.

Let’s get into vim to test what it can do.

Open a random text file you have with Vim to test what I am going to explain.

vim <random_file>

You start in normal mode, if you press i you will enter in insert mode at the cursor position while if you press a you will enter insert mode one character right from your current position.

You can use C-x n to complete words based in other words present on the file, if you start in the beginning of the line you can complete the entire line using C-x l and if you have other buffers open with C-n you can complete from any opened buffer.

With Esc or C-[ you may return to the normal mode.

The navigation in Vim has pretty much the flavour of the Screen one, but thinked for editing.

With o you can create a new line just at the bottom of the one your cursor is in and start in insert mode in the beginning of that line, O does the same but creates the line at the top of the current one.

With gg you may go to the start of the file, with G you can go to the end of the file and with 5G you may get internet go to the fith line of the file, that applies to every number.

dd deletes the current line, de deletes until the end of the current word or the next word if you are not in a word, dE does the same, but including puntuation, db deletes the previous word and dB the same including puntuation. There are more combinations for example 2de deletes the next 2 words.

To copy in Vim you can use the y which is used pretty much like d or use the visual mode.

The visual mode is entered with v and when you use it you select what you want to paste navigating with the normal mode keybindings until you end selecting everything you need and then press y and everything gets copied into the vim clipboard, if you want to cut you use d.

You can now paste with p or P.

If you want to open a new file in a new tab you use :tabnew <new_file> in normal mode, it allows you to autocomplete the filename using tab.

To comment multiple lines at once in a language without comment blocks C-v can be handy, it allows you to insert the same text on a position on multiple lines at once, for example 0C-vjjjIHola mundo<esc> will insert Hola mundo in the beginning of the current line and in the two lines after the current one.

The * allows you to jump to the next time some word appears while # allows you to jump to the previous time.

There are lots of things you can learn still about vim, if you are seriously into using it as IDE take a look at :vimtutor.

🙂

Categories
Not so computers Utena

Inspiring series: Revolutionary Girl Utena. (GIF compilation.)

Utena is a great anime which brings a great reflexion about stereotypes and their effect in adolescence. But this post objetive is only to drop great gifs about the anime I found in Duckduckgo.

The featured one is Jury getting the photo of the girl she secretly loved broke in the battle against Utena. Once again trying to demostrate miracles does not exists and once again Utena defeating she with a coincidence.

“Dios wants to show you the end of the world.”
I do not know the context since this is from the film, but looks pretty cool.
Nanami with her Cristian Dior cowbell.
Touga featuring Touga in Revolutionary Boy Touga.
Utena can make a dress with a mantel and I barely can sew up the broken pockets of a jean.
Categories
Uncategorized

If the code cannot be read it is not trustworthy software.

Often in the malware world one of the most important steps is the process to obfuscate the malicious software so investigators have a hard time guessing how to fight against it’s resilence and it’s goals.

The same happens with privative of freedom software, often the goal obfuscating the code it is not only because you want to protect your “intelectual property” but because you want to avoid investigators guessing how much and how your application surveillances it’s users.

Other common reason is you know your code is insecure, it is difficult/expensive to solve and you want to avoid people knowing it at the first look.

You or your users eventually will be cracked, but with some luck no one will know it, only hoping the cracker only wants the information and do not take down the service so people start making questions.

Of course there is also selfishness, people will depend of my solution because once they start using it they will have a really difficult time if they want to migrate out because they will have their data adapted to my privative format or tied to bussiness specific features that they will have to recreate in whatever new system they want to use.

Only if you can free your code you can prove your solution is really trustworthy or not, people will be able to tell it after reading your code.

Categories
google

Reading other’s mails is bad, and a crime in Spain. An article about Google.

Often we see criticism because Google pays less taxes than the Pymes in Spain, but what is not often said is Google also is breaking the constitutional right to the privacy on comunications in a daily basis.

Imagine you have the most important mail provider today and also control most of advertising on internet, a deadly combination to make money simply parse what your users buy or want to buy to advertise them similar things.

But that bussiness is illegal in Spain because only police with a judicial order can lawfully intercept comunications between parties!!!

Telefonica must not quietly listen your conversations over phone if it is done without a judicial order nor can Correos read your physical mail.

What gives Google the privilege of doing so with your mail?

Google goes a step further, it puts itself in the name of “cybersecurity” as intermediary in every link is sended in Gmail giving them realtime information about what services are you clicking and what you are more likely to click, the stricter the surveillance the greater the profits.

Stand up for digital rights and law avoiding services with similar polices in your enterprise and leverage your software with decentralized and robust free software solutions to protect your users and workers of the dystopia of surveillance capitalism.

Categories
Windows

Will we see any time soon the end of Windows in corporative environments?

I hope so, just other 2021 will be the year of the GNU/Linux desktop post.

As everybody knows Windows has been dominating the operative system desktop market for decades, but there is a live outside it and a lot of reputable tech people thinks it is time it ends.

Here I will drop some hints to understand that thought and to encourage enterprises to start upgrading user stations to the operative system of the future, GNU/Linux because the great advantages it has been giving over its legacy alternative Windows in a race of more than 20 years taking way better decisions for mantaintanibility and security.

The first is reason is just the common usage of users of Windows is a security nightmare with default execution permission for downloaded files is just to easy to be tricked to infect you, there is no need to escalate your privileges to Administrator since the most important information a user manages like passwords and sensible documents is just accesible from the privileges a common user has.

The second reason is Windows mades more difficult to users to automatize proccess with lite knowledge, the tools Windows gives without installing things, VBS, Powershell and CMD have greater learning curves and are less diverse than the GNU/Linux alternatives, Perl, Python, Bash, AWK, Sed, WSL makes something to solve it at the prize of not having good/easy integration with the Windows programs and requires installation of course.

The third reason is webapps, since they are easier and cheaper to program almost everything is moving to the web, if all the software a employee uses can be used from the web,. What do the OS matter? Why to pay licenses?

The fourth reason is support, as the time passes more and more tech persons use mostly GNU/Linux, finding IT support for your Windows environments can become more expensive since they are harder to administer and tech persons are starting to less contact with it. So it can be the time to migrate before Windows start being your own Cobol and you have to go to TV to pray for help to find someone to support you.

Relative to this migrating from a version of Windows to other is very difficult and expensive, the distro of your choice and continuous Ansible scripts to update after testing the new update and adapting the code makes the migration to new versions a continuous but less disruptive process.

I hope you find this post useful and you think about stepping out of Windows in your bussiness.