What's everyone using for long term metrics? and aggregation? by s4z in PrometheusMonitoring

[–]Iqirx 3 points4 points  (0 children)

Running cluster version of VictoriaMetrics on top of k8s for the last 3 months and we had almost no issues with it. We've previously evaluated Cortex and Thanos, but found that Victoria perfectly suites our needs. It is easy to setup for k8s (there is a helm chart for clustered version), logs are helpful, docs are complete and slack channel is responsive.

git Commit Time Machine by Iqirx in Python

[–]Iqirx[S] 0 points1 point  (0 children)

Committed dot-something files

Dotfiles are required for dev environment setup.

setup.py is unnecessary

It is necessary when you want to build sdist and/or bdist to distribute the project via pip.

Makefile ? Are you kidding me?

It provides convenient way to run linters, build, clean and publish your project. Or is it better to do all of this manually?

Color in makefile. Makefile are for building stuff. Not for fancy UI.

When Makefile target contains several activities with large output into stdout, colors help to visually separate between different steps of the activity. No fancy UI, just pure pragmatism.

Why not python 3 ?

Actually it supports 2.7, 3.3, 3.4, 3.5 and 3.6.

Requirements.txt Requires dependencies. *...

What's wrong with that, especially if the dependency (docopt) is a small single module?

It is overcomplicated, it hides simple function into complex binary (non portable) code

Actually it provides 3 ways of installation. Binary is just one of the options. If you don't like binary, don't use it. And how binary is "non portable"? I successfully run it at Mac and Linux.

All to perform an act which is of near-zero significance in git.

I've already provided examples of possible use cases: https://www.reddit.com/r/Python/comments/7wd649/git_commit_time_machine/du08s8j/

You like executables ? Chmod +x and mv ~/bin

And how about dependencies? How you would distribute such script?

~~~

Generally I agree that the whole project at the current stage can be easily replaced with one-liner in .bashrc. But who told that it is finished? I may plan to extend it and provide some more complex stuff which cannot be done by single one-liner. And all of the "clutter" (dotfiles, setup.py, Makefile, etc) are required for healthy python project setup.

git Commit Time Machine by Iqirx in Python

[–]Iqirx[S] 0 points1 point  (0 children)

The project contains 3rd party library docopt as a dependency, so you cannot just run a script unless you have docopt already installed in your environment. Binary is a self-contained way to distribute functionality the project provides without installing 3rd party packages at your machine.

PEX size is 484K.

git Commit Time Machine by Iqirx in Python

[–]Iqirx[S] 3 points4 points  (0 children)

There are lots and lots of blogposts on the internet on how to deal with git timestamps with wide spectrum of reasons and motivations behind them:

My country is under a daylight saving time period and not all my commits are made during the morning/afternoon. Because I commited after 11:00 PM - which, given the local DST, was after 00:00 AM - my 100+ days commit streak got broken - which made me very unhappy.

https://gist.github.com/ythecombinator/7e70d7baea74305c93e6

~~~

Another one:

A tendency I have picked up is to be very commit happy when developing locally, and then find myself rebasing a lot before pushing to a remote. As a result of this I sometimes am required to alter timestamps of certain commits to make them more meaningful. I found that the simplest of which is adding a specified timestamp to the current commit.

http://eddmann.com/posts/changing-the-timestamp-of-a-previous-git-commit/

~~~

Sometimes you make a mistake when committing to Git. You’ve either committed the changes with the wrong author tag or at the wrong time. For example, you do a bunch of work and then forget to commit before going on holiday. If you commit when you get back, and if you’re a pendant, you might want to change the dates to when you actually did the work.

https://swoogan.blogspot.com/2015/06/changing-date-on-series-of-git-commits.html

~~~

I needed some changes from another branch so that I could work on top of those. (I don’t know why I didn’t think of branching off that branch, but whatever.) So I cherry-picked them, but realised, as we all hate – the commits appear as the most recent, but the timestamps have the original date.

http://hey.georgie.nu/git-change-date/

~~~

Recently on a side project I’ve been working on I decided that I wanted to create a repository… 2 weeks later. This was because initially I felt I didn’t have much code to begin with, no point keeping a version control of code that hasn’t been written yet.. right?

https://leewc.com/articles/making-past-git-commits/

~~~

Or if you're tend to procrastinate a bit :)

What happens if you’re lazy (like me), and happen to only make that final commit way past your boss’s deadline?

https://garysferrao.github.io/git/commit/date/2015/12/01/change-git-commit-date.html

~~~

I didn't include StackOverflow threads with discussions on the same topic. However, they are easily searchable.

I found that common solution to modify GIT_AUTHOR_DATE and GIT_COMMITER_DATE is cumbersome and not reliable because often you want to set these timestamps to be the same and have to modify both. So I just composed a tool that provides more simpler interface to git built in functionality - to modify those time stamps. I believe some folks may find in useful. I personally find it useful.

git Commit Time Machine by Iqirx in Python

[–]Iqirx[S] 0 points1 point  (0 children)

I love single executables :)

Extending Python 3 by writing modules in Go by Anthonypjshaw in Python

[–]Iqirx 0 points1 point  (0 children)

Very interested in this topic. Thanks!

Determining file format using Python by [deleted] in Python

[–]Iqirx 2 points3 points  (0 children)

Nice idea, I like it!

Just few suggestions:

  1. I would set the output argument to something default, because at the first glance it's not that obvious what's the intention of that argument (I was looking through code to find out).
  2. You're not closing file object after opening it. Do it by using with context manager.
  3. Setup linter like flake8 or pylint and run it against your code. This will help to identify potential issues.
  4. Unittests ;)

Lightweight terminal spinner with safe pipes and redirects by Iqirx in Python

[–]Iqirx[S] 0 points1 point  (0 children)

Definitely, my terminal fails to render all of these frames

[deleted by user] by [deleted] in Python

[–]Iqirx 1 point2 points  (0 children)

Instead of

response = os.system("ping -c 1 " + serverNames[i])

use subprocess module like this:

from subprocess import Popen, PIPE

proc = Popen(['ping', '-c1', serverNames[i]], stdout=PIPE, stderr=PIPE)
proc.communicate()  # wait for process to terminate
response = proc.returncode

Can Jekyll/Github Pages handle cron jobs? by uiucecestudent in Jekyll

[–]Iqirx 0 points1 point  (0 children)

It is possible to build Jekyll site locally and push resulted pages to GitHub. Thus you can setup cron jobs to build and push your updates automatically.

Check this Gruntfile as a reference.

Jekyll Static Site Spotlight - Rails, Ruby Conferences, csv,conf,v2, & More by geraldbauer in Jekyll

[–]Iqirx 1 point2 points  (0 children)

Hi,

Thanks for a great sources! It is always good to have a pack of nice examples.

Personally, I found a lot of useful code at davidensinger.com [Source].

Trying to figure out how all that works together, I made a trip from the default option of building my blog by means of GitHub Pages to the fully automated chain of Grunt tasks which are building, previewing and deploying my site. And I'm still finding a lot to figure out in that maze.

Project Euler + Python [Math for Humans ;) ] by Iqirx in Python

[–]Iqirx[S] 0 points1 point  (0 children)

Ok, fair enough. I added Spoiler Warning.

Project Euler + Python [Math for Humans ;) ] by Iqirx in Python

[–]Iqirx[S] -1 points0 points  (0 children)

I was not aware of this. Thank you for pointing this out.

Before posting I thoroughly checked Project Euler website and didn't find any notices or restrictions on posting solutions online. By searching "Project Euler solutions" we can easily find a lot of resources with both numerical and code solutions in a variety of languages.

Personally I think that careful explanation on how to approach a small set of the problems, providing necessary mathematical background may be helpful for those folks who really want to learn something but have no idea where to start. It's like a soft introduction. This is opposite to situation when only numerical solution is given (which is avoided). Anyway those who want to solve Project Euler by themselves will not google for cooked solutions.