Language Selection

English French German Italian Portuguese Spanish

Programming: Bash/Command Line, Python and More

Filed under
Development
HowTos
  • Add leading zeroes that aren't really leading

    A leading zero can be a useful addition to a number string, and there are several ways to add one or more leading zeroes on the command line. The addition is a little less straightforward if the leading zero sits inside a non-numeric string. This post deals with a couple of such cases.

  • Always Launch Terminal as root User (sudo) in Ubuntu

    While working with the Ubuntu command line, the Terminal, we come across situations that require us to log in as root again and again. Ubuntu does that for protecting our system in order to avoid any user or script that opens the Terminal for any malicious activities that put your privacy and system at risk. Root allows far more access than a standard user needs on the command line. With root in action, features that make Ubuntu more secure are no longer working for you. Just consider running a web browser as root!

  • Fastest Python function to slugify a string

    The code is 7-8 years old and relates to a migration when MDN was created as a Python fork from an existing PHP solution.

    I couldn't help but to react to the fact that it's a list and it's looped over every single time. Twice, in a sense. Python has built-in tools for this kinda stuff. Let's see if I can make it faster.

  • Should you use "dot notation" or "bracket notation" with pandas?

    If you prefer bracket notation, then you can use it all of the time! However, you still have to be familiar with dot notation in order to read other people's code.

    If you prefer dot notation, then you can use it most of the time, as long as you are diligent about renaming columns when they contains spaces or collide with DataFrame methods. However, you still have to use bracket notation when creating new columns.

  • Solving Sequence Problems with LSTM in Python's Keras Library

    Time series forecasting refers to the type of problems where we have to predict an outcome based on time dependent inputs. A typical example of time series data is stock market data where stock prices change with time. Similarly, the hourly temperature of a particular place also changes and can also be considered as time series data. Time series data is basically a sequence of data, hence time series problems are often referred to as sequence problems.

  • How the Worlds of Linux and Windows Programming Converged

    Once upon a time, the world of developers was split into two halves: One half was composed of Windows developers, who created most of the productivity apps that powered PCs (and, occasionally, servers). The other half comprised Linux and Unix developers, whose work focused on server-side development. Today, however, as the worlds of Windows and Linux move ever closer together, the distinction between Windows and Linux developers is disappearing. Gone are the days when you had to specialize in one ecosystem or the other.

More in Tux Machines

Python Programming Leftovers

  • Cogito, Ergo Sumana: Futureproofing Your Python Tools

    The people who maintain Python and key Python platforms want to help you protect the code you write and depend on. [...] Publishing that package is a great way of making it so other people can run and deploy it, even within other parts of your organization. But -- who actually has the keys to the castle? Who can upload a new version, or delete a version that has a problem? You should probably make sure multiple people have either "owner" or "maintainer" privileges on the project on PyPI. And you should review your project security history display, which lists sensitive events (such as "file removed from release version 1.0.1") in your PyPI user account and your PyPI project. We just added this display, so you can look at things that have happened in your user account or project, and check for signs someone's stolen your credentials.

  • py3status v3.20 – EuroPython 2019 edition

    Shame on me to post this so long after it happened… Still, that’s a funny story to tell and a lot of thank you to give so let’s go!

  • Finding Python Developers for Your Startup

    Recently I stumble across a situation while I was helping out for one of the events for JuniorDev SG. There was not a lot of Python developers and some of my other developer's friend. Said that they hardly encounter any developer friends who are using Python for their work. It begins during a conversation, where one of the attendees for a JuniorDev SG event. Approached me to search for Python developers to work for their startup based in Singapore.

Geary 3.34 Debuts with Deeper GNOME Contacts Integration, Other Changes

The Geary email client has issued a brand new release, and in this post I tell you a bit about it. Geary 3.34.0 — you may recall that Geary switched to following GNOME numbering last year — is the latest update to this web-mail friendly mail tool, and there’s healthy dose of improvement on offer, as noted in the release notes. Among them is deeper integration with GNOME Contacts. Geary’s in-app contacts pop-over now supports adding and editing contacts stored in the GNOME Contacts app, and is able to auto-complete email addresses based on data from contacts too. Serial typo-makers like me will appreciate the spell checker now covering the mail composer’s subject line; while the addition of support for Outlook-specific email attachments (TNEF) will please those who regularly run in to issues on that front. Other changes in Geary 3.34.0 include “a substantial number” of server compatibility improvements, background syncing tweaks, and other bug fixes. Read more

today's howtos

Best free Linux firewalls of 2019: go beyond Iptables for desktops and servers

Linux distros will often come with at least a basic firewall bundled with it. Often this won't be active by default so will need to be activated. Additionally this will likely be the standard Iptables supplied, even though less experienced users may struggle with it. UFW - Uncomplicated Firewall is also bundled with some distros, and aims to make the process simpler. However, there are distros and applications out there that can cater for the more advanced user and the less experienced one, making it easier to setup and configure a firewall that works for your needs. Some, like ClearOS build it directly into the operating system as part of its security focus, but most other options would be applications that aim to block rogue IPs, monitor ports, and prevent otherwise prevent bad packets from interfering with your machine. For most home users there are few actual settings that need to be customized, so simple apps can be popular, but for those looking to manage their machine as a server, additional controls and advanced command options will tend to be the more welcome. Read more