פלאנט תוכנה חופשית בישראל (Planet FOSS-IL)

28 May, 2023

Hamakor

הזמנה לאסיפה כללית של העמותה – 28.5.23

שלום לחברי וחברות עמותת המקור, ידידים וידידות, ושותפים ושותפות לדרך,

בתאריך 28.5.23, ביום ראשון בשעה 18:00 (בתחילת מיטאפ "המקור") תכונס אסיפה כללית של עמותת המקור – עמותה ישראלית לתוכנה חופשית וקוד מקור פתוח (ע"ר). 

שימו לב: האסיפה פתוחה לכלל חברי העמותה, ולא רק למשתתפי המיטאפ

האסיפה תתקיים:

  1. בחלל Brain Embassy (רחוב השלושה 2) בתל אביב, בשעה 18:00 ביום ראשון ה-28.5
    (מגדל Adgar360, קומת קרקע מגדל A, אולם כנסים)
  2. אונליין דרך זום – קישור להתחברות לזום

לוח זמנים:

במידה ובמועד שנקבע לא יהיה קוורום (רבע מכלל חברי העמותה), האסיפה תדחה בשעה ותתקיים באותם אמצעים, בכל הרכב שהוא (במקרה כזה הלו"ז מעלה עשוי להשתנות).

פרטים טכניים:

טיוטות הדוחות יועברו לעיון החברים לפני האסיפה. אנו מקווים שדיון עליהם, או על כל נושא אחר בסדר היום, יתקיים בפורומים של העמותה, בכתב, לפני האסיפה. זאת, הן משיקולי אסינכרוניות והן משיקולי חיסכון בזמן באסיפה.

הצבעות יתקיימו באופן גלוי לחלוטין, משיקולי זיהוי. משתתפים פיזית – תתבצע הצבעה בהרמת יד. 

משתתפי אונליין – לא תתאפשר הצבעה ללא הזדהות ויזואלית בוידאו, לכן, אנא בידקו את המצלמה טרם תחילת האסיפה.

חבר/ת עמותה שירצו להשתתף בהצבעות אך לא יוכלו להשתתף באסיפה, יוכלו לשלוח הודעת ייפוי כח לועד, המפרטת את ההצבעות, עם חתימתם (כן, הפיזית, מצולמת, על הדף שבו כתובות ההצבעות. לא חתימה דיגיטלית). למען הסר ספק, משתתפים באמצעות ייפוי כח לא יספרו לצורך קוורום, אלא רק יחשבו בהצבעות.

אנו מזכירים לכולם לשלם את דמי החבר לעמותה. הודעה על מצב התשלום תצא לחברי וחברות העמותה. 

לנוחיותכם קישור להצטרפות כידידי/חברי העמותה ולשדרוג מעמד מידיד/ת לחבר/ת העמותה.

בברכה,

ועד עמותת המקור

The post הזמנה לאסיפה כללית של העמותה – 28.5.23 first appeared on המקור.

28 May, 2023 01:04 PM

24 May, 2023

Hamakor

פרוטוקול אספת ועד 18-05-2023

התקיימה באמצעות תקשורת נתונים בשיחת וידאו

נוכחים:
חברי וחברות עמותה: ענבל לוי, אביב סלע, שני לויים, שי גובר, גיא שפר, עידן מיארה, משה נחמיאס, עמית ארונוביץ'

האספה נפתחה ב 20:00

נושאים שנידונו:

  1. חלוקת תפקידים ואחריות בתוך הוועד
  2. תכנון מיטאפ "המקור", ומיטאפים עתידיים
  3. הצבעה: אישור חריגה מתקציב שנתי לכנס פייקון (על חשבון עודפים של שנים קודמות) – אושר פה אחד
  4. קידום אישור דוחות לשנת 2022

האספה נסגרה ב 21:30

The post פרוטוקול אספת ועד 18-05-2023 first appeared on המקור.

24 May, 2023 01:41 PM

02 May, 2023

Shlomi Noach

Things that don’t work well with MySQL’s FOREIGN KEY implementation

Foreign keys are an important database construct, that let you keep an aspect of data integrity within your relational model. Data integrity has many faces, most of which are application-specific. Foreign keys let you maintain an association integrity between rows in two tables, one being the parent, the other being the child. I’ve personally mostly avoided using foreign keys in MySQL for many years in my professional work, for several reasons. I’d like to now highlight things I find to be wrong/broken with the MySQL implementation.

But, first, as in the past this caused some confusion: when I say I’m not using foreign keys, that does not mean I don’t JOIN tables. I still JOIN tables. I still have some id column in one table and some parent_id in another. I still use the benefit of the relational model. In a sense, I do use foreign keys. What I don’t normally is the foreign key CONSTRAINT, i.e. the declaration of a CONSTRAINT some_fk FOREIGN KEY ... in a table’s definition.

So here are things I consider to be broken, either specific to the MySQL implementation, or in the general concept. Some are outright deal breakers for environments I’ve worked with. Others are things to work around. In no particular order:

No binary log entries for cascaded writes

I think there are many people unaware of this. In a way, MySQL doesn’t really support foreign keys. The InnoDB engine does. This is old history, from before InnoDB was even officially a MySQL technology, and was developed independently as a 3rd party product. There was a time when MySQL sought alternative engines. There was a time when there was a plan to implement foreign keys in MySQL, above the storage engine level. But as history goes, MySQL and InnoDB both became one with Oracle acquiring both, and I’m only guessing implementing foreign keys in MySQL became lower priority, to be eventually abandoned.

Alas, the fact foreign keys are implemented in the storage engine level has dire consequences. The engine does not have direct access to the binary log. If you create a foreign key constraint with ON DELETE|UPDATE of SET NULL or CASCADE, you should be aware that cascaded operations are never written to the binary log. Consider these two tables:

CREATE TABLE `parent_table` (
  `id` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

CREATE TABLE `child_table` (
  `id` int NOT NULL,
  `parent_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_id_idx` (`parent_id`),
  CONSTRAINT `child_parent_fk` FOREIGN KEY (`parent_id`) REFERENCES `parent_table` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

insert into parent_table values (1);
insert into child_table values (1, 1);
insert into child_table values (2, 1);

If you were to DELETE FROM parent_table WHERE id=1, then the two rows in child_table are also deleted, due to the CASCADE rule. However, only the parent_table deleted row is written in the binary log. The two child_table rows are deleted internally by the InnoDB engine. The assumption is that when a replica applies the DELETE on parent_table the replica’s own InnoDB engine will likewise delete the two relevant child_table rows.

Fair assumption. But we lose information along the way. As Change Data Captures are becoming more and more common, and as we stream changes from MySQL to other data stores, the DELETEs on child_table are never reflected and cannot be captured.

Online DDL, aka online schema changes

I’ve written about this at length in the past. But even that write up is incomplete!

MySQL is pushing towards INSTANT DDL, which is a wonderful thing. With 8.0.29, even more schema change operations are supported by ALGORITHM=INSTANT. But, there’s still quite a lot of operations unsupported yet, and until such time that INSTANT DDL supports all (or at least all common) schema changes, Online Schema Change tools like gh-ost, pt-online-schema-change, and Vitess (disclaimer: I’m a Vitess maintainer and actively developing Vitess's Online DDL), are essential when it comes to production changes.

Both Vitess and gh-ost tail the binary logs to capture changes to the table. In light of the previous section, it is impossible to run such an Online Schema Change operation on a foreign key child table that has either SET NULL or CASCADE rule. The changes to the table are never reflected in the binary log. pt-online-schema-change is also unable to detect those changes as there’s nothing to invoke the triggers.

Then, please do go ahead and read The problem with MySQL foreign key constraints in Online Schema Changes, as it goes deep into what it otherwise means to deal with FK constraints in Online DDL, as it cannot fit in this post.

Locked data types

In the above table definitions, id and parent_id are int. As data grows, I might realize the choice of data type was wrong. I really should have used bigint unsigned.

Alas, it is impossible to change the data type in either parent_table or child_table:

> alter table parent_table modify column id bigint unsigned;
ERROR 3780 (HY000): Referencing column 'parent_id' and referenced column 'id' in foreign key constraint 'child_parent_fk' are incompatible.

> alter table child_table modify column parent_id bigint unsigned;
ERROR 3780 (HY000): Referencing column 'parent_id' and referenced column 'id' in foreign key constraint 'child_parent_fk' are incompatible.

It’s impossible to do that with straight-DDL (never mind INSTANT), and it’s impossible to do that with Online DDL. InnoDB (not MySQL) flatly refuses to accept any change in the related columns’s data type. Well, it’s not really about changing them as it is about having an incompatibility. But then, we can’t change either. The column type changes are only made possible if we modify the child table to remove the foreign key constraint, then alter both parent and child to modify the respective columns types, then re-add the foreign key constraint. There are four different ALTER TABLE statements. Neither removing nor adding a foreign key constraint is supported in INSTANT algorithm, so you can expect a long time in which the foreign key relationship simply does not exist!

CREATE TABLE … LIKE

One of those quirks that come with InnoDB owning the foreign key definition, is that CREATE TABLE ... LIKE does not generate foreign keys. I think this is mostly an oversight. A SHOW CREATE TABLE statement does produce foreign key output, so I’m not sure why CREATE TABLE ... LIKE doesn’t. Continuing our above child_table example:

> create table child_table_copy like child_table;
Query OK, 0 rows affected (0.06 sec)

> show create table child_table_copy \G
*************************** 1. row ***************************
       Table: child_table_copy
Create Table: CREATE TABLE `child_table_copy` (
  `id` int NOT NULL,
  `parent_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_id_idx` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

Unique constraint names

I know this is ANSI SQL, and so I won’t fault MySQL for this. I do think this is one of those scenarios where deviating from ANSI SQL would be beneficial. A foreign key constraint has a name (if you don’t provide one, one is auto-generated for you). And, that name, according to ANSI SQL, has to be unique across your schema. It means the following table conflicts with our original child_table:

CREATE TABLE `another_child_table` (
  `id` int NOT NULL,
  `parent_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_id_idx` (`parent_id`),
  CONSTRAINT `child_parent_fk` FOREIGN KEY (`parent_id`) REFERENCES `parent_table` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB;

You can’t have two foreign key constraints both named child_parent_fk.

I never understood that limitation. See, it’s just fine the tables both have a key named parent_id_idx. No conflict about that. Why do foreign keys have to have unique names?

Maybe, in ANSI SQL, foreign keys can be independent constructs, living outside the table scope. Meh, even so this could be technically solved using some sort of namespace. But, in MySQL this isn’t the case in the first place. Foreign keys are part of the table definition.

This is again just painful for Online DDL, or for any automation that tries to duplicate tables on the fly.

Lack of declarative-only definitions

This is more of a “I wish this existed” rather than “this is wrong”. One of the greatest benefits of foreign keys is the graph. Given a schema with foreign keys, you can formally analyze the relationships between tables. You can draw the dependency graph. It’s really educating.

What I wish for is to have a declarative-only foreign key definition. One that does not actually enforce anything. Merely indicates an association. Something like so:

CREATE TABLE `child_table` (
  `id` int NOT NULL,
  `parent_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `parent_id_idx` (`parent_id`),
  DECLARATIVE FOREIGN KEY (`parent_id`) REFERENCES `parent_table` (`id`)
)

The declarative foreign key could still enforce the existence of the parent table and referenced column, definition-wise, but do nothing at all to enforce relationship of data.

Anyway, just a wish.

SET FOREIGN_KEY_CHECKS

I love that we have set foreign_key_checks. But it’s a bit inconsistent. Basically, set foreign_key_checks=0 lets you override foreign key constraints. You can do any of the following:

But, why oh why, will set foreign_key_checks=0 not let me:

Limited to server scope

This one becomes obvious as your data grows. If you use foreign keys and you rely on their behavior (e.g. your app relies on a DELETE to fail if there’s dependent rows in children tables), and your data set grows such that a single server does not have the write capacity, you’re in trouble.

You may attempt to do functional sharding. You will hopefully find two subsets of your schema’s tables, that are not connected in the foreign key graph. If so, you win the day. But if it’s all connected, then you have to break some relationships. You’d have to audit your app. It previously assume the database would take care of data integrity, and now, for some relationships, it wouldn’t.

Or you may want to have horizontal sharding. If you mean to keep foreign key constraints, that means you need to find a way to co-locate data across the entire dependency graph. Unless this was pre-designed, you will probably find this to be impossible without a major refactor.

Vitess is looking into FOREIGN KEY implementation. It will attempt to address some of the above limitations. See https://github.com/vitessio/vitess/issues/11975 and https://github.com/vitessio/vitess/issues/12967 for some preliminary write ups and tracking.

02 May, 2023 04:01 AM

24 April, 2023

Ilya Sher

Naming in Software – Practical Guide

The title of the post is the title of the book that I wanted to publish for quite some time now. While I was thinking about phrasing and gathering content, somebody else beat me to it with Naming Things: The Hardest Problem in Software Engineering. The main issue that I wanted to solve is now solved. Programmers don’t have an excuse for poor naming anymore.

In light of this event, I’ve decided to make small complementary post out of the materials that I have gathered and move on, focusing on Next Generation Shell.

Me and Naming

I have over 20 years of professional experience in programming. During that time, as many others, I’ve also noted the struggle when it comes to naming.

Here is a list of my accepted naming contributions to various projects.

  1. iterators – function shoes_in_my_size naming 2020-02-16, “The Rust Programming Language” book
  2. Constructors – Get_Contents() method is misnamed 2020-02-23, MS C++ Documentation
  3. Rename howMany() to countSelected() 2023-01, MDN
  4. nilJson naming issue in readme 2023-04, Otterize

Naming Things, the Book

I skimmed Tom’s book to understand how similar it was to what I was about to write. Quite close. If you are struggling with naming, go and read it.

There is some amount of fluff which I think my book would have less. Example: convincing people that naming is important while they are already reading the book.

Overall, I do recommend the book though.

Especially I recommend this book to AWS as an organization, I guess along with other books about code quality in general. AWS, your de-prioritization of code quality is staggering. I mean observable output here, not the stated “Insist on the Highest Standards”.

6.2.6 Use accurate parts of speech

Adding negative example from AWS:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html

SUCCESS and FAILED are not the same part of speech.

7.2.3 Omit Metadata

Additional reason to exclude data type from the name is to avoid additional changes anywhere in the code except for the declaration.

elt in items

Is items a list here or a set? Probably not important, the code should work with either. On the other hand, changing data type from list to set in the following example will make the code incorrect:

elt in items_list

8.2.4 Use similar names for similar concepts

Adding negative example from AWS, which time after time fails to give consistent names across their APIs.

How do you limit number of results from an API? MaxResults, maxResults, MaxRecords, MaxItems, Limit, limit, … Details at AWS API pagination naming.

It looks like consistent naming is valued less than independence of teams and ability of teams to perform uncoordinated work.

8.2.5 Use consistent antonyms

Adding example.

When I’ve got to name Option type (represents a container that can hold a value or can be empty) in Next Generation Shell, I went with straightforward antonyms.

Authors of other languages preferred other naming conventions:

Scala: Option, None, Some

Haskell: Maybe, Nothing, Just

Perspective

Information Loss

In my perspective, giving inadequate names is part of a larger issue – Information Loss. Each time you give a name, think which information is now in your head which will be helpful to the reader of the code. If you don’t phrase it concisely and precisely, information loss occurs between your head and the code you are working on. There are several common types of errors one can make:

  1. Don’t provide enough information. Causes the reader to investigate in order to recover the information.
  2. Provide wrong information. That’s the worst, it’s misleading the reader.
  3. Provide too much information. The reader then must sift through the information to get to the relevant parts.

API

Sometimes it’s useful to think of methods as an API. That’s why method names shouldn’t include implementation details (with rare exceptions when they are important to the caller). Think of methods’ names and parameters’ names as a short version of API specification.

Identifiers

Tom’s book deals with naming identifiers, such as functions, classes, variables, etc. One step before naming an identifier is the question whether there should be an identifier.

Avoid Naming

Sometimes, the additional cognitive load is not worth it.

# Bad
chairs = fetch_chairs()
sorted_chairs = chairs.sort()
# also, now have to use the longer identifier in the code below

# Good
chairs = fetch_chairs().sort()

Apply your judgement of course. If it’s a 20 step process, additional identifiers in the middle do contribute to understanding. You still probably don’t want an identifier for each and every step of the calculation.

Do Name – Magic Numbers

Avoid magic numbers through naming. Please ignore whether result is a good name 🙂

# Bad
if result == 126 { ... }

# Good
NOT_EXECUTABLE = 126; # Or better, part of an Enum

if result == NOT_EXECUTABLE { ... }

Do Name – Repetitive Code

If you notice code that repeats, with rare exceptions, you should refactor your code extracting that code to a function or a method with a name.

Several Identifiers

Sometimes a function, a method, or a class do several things. In this case, you might struggle to name it. In a perfect world, the solution to this is refactoring to appropriate pieces.

Test Your Naming

You just named something: a function, a method or a class. Is there a change around the code that would make the name wrong? What if you copy+paste the named piece of code to another project? Would you need to change the name?

# Bad
function start_yellow_cars(cars) { ... } # The function doesn't know or care about the color
yellow_cars = ...
start_yellow_cars(yellow_cars)

# The change that would highlight the wrong naming
# while keeping the code completely functional
function start_yellow_cars(cars) { ... }
my_cars = ...
start_yellow_cars(my_cars)


# Good
function start_cars(cars) { ... }
yellow_cars = ...
start_cars(yellow_cars)

Common Naming Mistakes Observed

  1. Naming a data structure with “JSON” in name.
  2. Argument vs Parameter

Tooling

I highly recommend using IDEs that “understand” the code enough to be able to refactor/rename (classes, methods, functions, parameters) as opposed to text editors which can not assist with renaming to the same extent.


Hope this helps. Happy naming!

24 April, 2023 05:05 AM

21 April, 2023

Ilya Sher

gRPC + REST API on AWS

Showing a setup of gRPC service which is also exposed as a REST API. It’s a setup that happens to work for us. No alternatives will be discussed in this post.

This is a concise blog post.

Architecture

  1. ALB with HTTPS listener (trivially configured, out of scope of this post)
  2. ECS running a task with 3 containers:
    • API Gateway. Implemented by Envoy. does:
      • requests authorization using the service in next container
      • proxies gRPC requests
      • proxies REST requests (converting them to upstream gRPC requests).
    • authorization service implemented with OPA
    • Our gRPC application

Notes

Health checks are not in very good shape yet

ECS Configuration (Simplified Excerpt)

In case the reader is not familiar, it CloudFormation below.

  TaskDefinition:
    Type: AWS::ECS::TaskDefinition
    Properties:
      ContainerDefinitions:
        - Name: apigw
          Image: !Ref ApiGwImage
          PortMappings:
            - ContainerPort: !Ref ContainerPort
        - Name: opa
          Image: !Ref OpaImage
          PortMappings:
            - ContainerPort: 9191
        - Name: app
          Image: !Ref AppImage
          PortMappings:
            - ContainerPort: 4000

  Service:
    DependsOn:
      - GrpcListenerRule
      - RestListenerRule
      - GrpcTargetGroup
      - RestTargetGroup
    Type: AWS::ECS::Service
    Properties:
      ServiceName: !Ref ServiceName
      Cluster: !Ref Cluster
      TaskDefinition: !Ref TaskDefinition
      LoadBalancers:
        - ContainerName: apigw
          ContainerPort: !Ref ContainerPort
          TargetGroupArn: !Ref GrpcTargetGroup
        - ContainerName: apigw
          ContainerPort: !Ref ContainerPort
          TargetGroupArn: !Ref RestTargetGroup

  GrpcTargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      HealthCheckIntervalSeconds: 10
      HealthCheckPath: /
      HealthCheckTimeoutSeconds: 5
      Matcher:
        GrpcCode: "0-99"
      UnhealthyThresholdCount: 2
      HealthyThresholdCount: 2
      Port: !Ref ContainerPort
      Protocol: HTTP
      ProtocolVersion: GRPC
      TargetGroupAttributes:
        - Key: deregistration_delay.timeout_seconds
          Value: 60 # default is 300
      TargetType: ip
      VpcId: !ImportValue VpcId

  RestTargetGroup:
    Type: AWS::ElasticLoadBalancingV2::TargetGroup
    Properties:
      HealthCheckIntervalSeconds: 10
      HealthCheckPath: /rest/not-found
      HealthCheckTimeoutSeconds: 5
      Matcher:
        HttpCode: 404
      UnhealthyThresholdCount: 2
      HealthyThresholdCount: 2
      Port: !Ref ContainerPort
      Protocol: HTTP
      ProtocolVersion: HTTP1
      TargetGroupAttributes:
        - Key: deregistration_delay.timeout_seconds
          Value: 60 # default is 300
      TargetType: ip
      VpcId: !ImportValue VpcId

  GrpcListenerRule:
    Type: AWS::ElasticLoadBalancingV2::ListenerRule
    Properties:
      Actions:
        - Type: forward
          TargetGroupArn: !Ref GrpcTargetGroup
      Conditions:
        - Field: path-pattern
          PathPatternConfig:
            Values:
              - '/censored.v1.CensoredService/*'
              - '/censored.v1.CensoredAdminService/*'
              - '/censored.v1.CensoredSystemService/*'
      ListenerArn: ...
      Priority: 1000

  RestListenerRule:
    Type: AWS::ElasticLoadBalancingV2::ListenerRule
    Properties:
      Actions:
        - Type: forward
          TargetGroupArn: !Ref RestTargetGroup
      Conditions:
        - Field: path-pattern
          PathPatternConfig:
            Values:
              - '/rest/v1/*'
      ListenerArn: ...
      Priority: 1001

Envoy Configuration (Simplified Excerpt)

static_resources:
  listeners:
    - address:
        socket_address:
          address: 0.0.0.0
          port_value: 8000
      filter_chains:
        - filters:
            - name: Connection Manager
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                via: CensoredGW
                route_config:
                  name: Static response for tests
                  virtual_hosts:
                    - name: backend
                      domains:
                        - "*"
                      routes:
                        - match:
                            prefix: "/test/static"
                          direct_response:
                            status: 200
                            body:
                              inline_string: "Static response for tests"
                        # Reference: https://envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter#route-configs-for-transcoded-requests
                        - match:
                            prefix: "/"
                          route:
                            cluster: upstream
                            timeout: 60s
                http_filters:
                  - name: envoy.filters.http.grpc_json_transcoder
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder
                      # maybe disable later:
                      auto_mapping: true
                      proto_descriptor: "../path/to/proto_descriptor.bin" ### See next heading in this post
                      services:
                        - censored.v1.CensoredService
                        - censored.v1.CensoredAdminService
                        - censored.v1.CensoredSystemService
                      print_options:
                        add_whitespace: true
                        always_print_primitive_fields: true
                      request_validation_options:
                        reject_unknown_method: true
                        reject_unknown_query_parameters: true
                  - name: envoy.filters.http.cors
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
                  - name: envoy.ext_authz
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
                      failure_mode_allow: false
                      with_request_body:
                        max_request_bytes: 10485760 # 10M
                        allow_partial_message: false
                        pack_as_bytes: true
                      transport_api_version: V3
                      grpc_service:
                        envoy_grpc:
                          cluster_name: opa-agent
                        timeout: 10s
                  - name: envoy.filters.http.router
                    # https://github.com/envoyproxy/envoy/issues/21464
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
                always_set_request_id_in_response: true
                access_log:
                  - typed_config:
                      "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
                      # https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#config-access-log-default-format

  # Based on https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/grpc_json_transcoder_filter
  clusters:
    - name: opa-agent
      connect_timeout: 0.25s
      type: STRICT_DNS
      typed_extension_protocol_options:
        envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
          "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
          explicit_http_config:
            http2_protocol_options: { }
      lb_policy: ROUND_ROBIN
      load_assignment:
        cluster_name: service
        endpoints:
          - lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: 127.0.0.1
                      port_value: 9191
    - name: upstream
      type: STRICT_DNS
      typed_extension_protocol_options:
        envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
          "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
          explicit_http_config:
            http2_protocol_options: {}
      load_assignment:
        cluster_name: grpc
        endpoints:
          - lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: 127.0.0.1
                      port_value: 4000

proto_descriptor.bin

GrpcJsonTranscoder must have the proto descriptor file in order to know how to transcode. The file contains:

  1. proto definitions of your services, including extension that describes how to expose the services as REST
  2. dependencies of the above proto definitions

The descriptor file is generated using a command similar to the following:

buf build -o proto_descriptor.bin --as-file-descriptor-set --path path/to/my.proto

buf is a way to manage .proto files and their dependencies (very imprecise definition, sorry)

If I remember correctly, you can generate the descriptor with protoc (without buf) but I don’t remember how.

grpcurl

Same descriptor file is used with grpcurl when you later test your service from the command line:

grpcurl -H "Authorization: Bearer ..." -protoset proto_descriptor.bin "example.com:443" censored.service.name/MyFunc

my.proto

This is how a protobuf definition with REST extension looks like (excerpt):

import "google/api/annotations.proto";

service Censored {
  rpc MyCreate(CreateRequest) returns (CreateResponse){
    option (google.api.http) = { post: "/rest/v1/my-objs" };
  }
  rpc MyGet(GetRequest) returns (GetResponse) {
    option (google.api.http) = { get: "/rest/v1/my-objs/{id}" };
  }
}

Excerpt from buf.yaml corresponding to the import above:

version: v1

deps:
  - buf.build/googleapis/googleapis


Hope this helps.

Sorry, I was in a rush to get this out. If anything is unclear or missing, please let me know.

21 April, 2023 06:04 AM

18 April, 2023

Boris Shtrasman

openstreetmap.org מציג שמות רחובות בשפה הלא נכונה (ערבית בממשק אנגלי או עברי)

בכל מקום שייכלתי תמיד דחפתי את osm, כי זה הפתרון החופשי והנגיש לכולם, אבל גיליתי משהוא די מעצבן לאחרונה, שימוש בשפה הערבית בלבד במיפוי מקומות ציבוריים ואזורי תעשייה. 
 
בגלל שבאתר OSM לא מתבצעת התאמה לבין אילו שפות הדפדפן מעדיף ומה שמוצג בפועל למי שמחובר ללא חשבון, ישנה הצגה בשפה הערבית לאדם שתמשתמש בממשק אנגלי או עברי, שוואלה אלא אם אתה לא תייר שלא מבין מה הולך פה אתה רואה אמרה פוליטית. גם בצד הדובר ערבית זה מעצבן כי אם משתמשים בסביבה בשפה הערבית חלק מהמקומות מוצגים בשפה העברית הייכן שרק כתוב בשפה העברית על המפה. החלק החשוב הוא שהמון אתרים מחזיקים את osm כחלק אינטגרלי מהאתרים שלהם בו הם נותנים שירות ללקוחות שלהם (חברות האוטובוסים למשל).

במפות govmap או מפות גוגל כן רואים את שמות הרחובות בשפת הממשק או שניתן להחליף בקלות ללא פתיחת חשבון, בדקתי בשפה הערבית את מפות גוגל למשל והוא הציג בצורה נכונה את השמות העבריים בעברית ובערבית כשבוחרים בשפה הערבית. שם יש כתיבה בשפה האחרת.
 
למשל אזור התעשייה עידן הנגב המשותף בין רהט, בני שמעון ולהבים שמות הרחובות מופיעים רק בשפה הערבית, שם למשל לקחו את השמות העבריים כמו רחוב היצירה ורשמו לالخلق (כן ממש תרגמו ולא השתמשו בשם העברי),  אני חותם פה, למרבית העוברים באזור אין סיכוי לקרוא או להשתמש במפה כי, וואללה מרביתנו לא דוברים את השפה. בחברות האוטבוסים שבדקתי מופיע רחוב היצירה ולא אחולקה. רחוב עומר אל-מוח'תאר (ככה הוא מופיע במפות בעברית ) למשל מופיע בשמות התחנות בחברות האוטובסים בממשק עברי אשר משתמשת גם ב OSM בשביל להציג את המסלול , רק שאין סיכוי למי שאינו יודע קרוא וכתוב בערבית להבין את  שם הרחוב על המפה.
 
ברהט למשל (ששם האמת יש רוב מוחלט לדוברי השפה הערבית), יש תרגום מילולי כמו לציון השכונות השתמשו ב  حيّ , הייתי מצפה שאם אדם מחובר בשפה האנגלית הוא באמת ייראה את רחוב  A-Salam ולא شارع السلام , או רחוב א-סאלם אם מדובר בשפה העברית, וממש לא רחוב השלום או peace street.

נכון לעכשיו OSM כרגע לא שמיש בעליל לאף תייר או מי שאינו דובר את השפה הערבית והעברית כמו שצריך.

18 April, 2023 11:13 AM

12 April, 2023

Artyom Beilis

לחבר שני תחביבים

אני חובב אסטרונומיה. בתור חובב אסטרונומיה אני סובל ואחת הבעיות הגדולות של העולם המודרני - זיהום אור. יש המון גרמי שמיים חיוורים כמו גלסקסיות וערפיליות שפשוט לא ניתן לראות מהעיר. בשביל זה צריך לנסוע לנגב או לרמת הגולן ולבלות לילה בתצפית. זה מאוד כיף כמובן. אבל זה לא תמיד נגיש.

אחד המעקפים לבעיה זה שימוש בצילום. מצלמה שיכולה לאגור פוטונים מגלקסיות מרוחקות ומאפשרת לחדור דרך שכבת זיהום אור כבדה ולהראות לנו גרמי שמיים עמומים. זה כמובן לא תחליף לצפייה ישירה אבל גם נותן יתרונות רבים אחרים. במובן, צילום אסטרונומי הוא נושא מורכב שדורש שימוש בתוכנות ייעודיות: איסוף תמונות רבות ככל הניתן, ועיבוד שלהם (הערמה) כדי לקבל תמונה יפה של איזו ערפיליות או גלקסיה.

אמרנו לינוקס?

אז מה המצב התוכנה בתחום זה מבחינת תוכנה חופשית ולינוקס? יש ויש. חלק הארי של הכלים הם חופשיים/קוד־פתוח. יש לא מעט תוכנה ללינוקס, אם כי הדברים הטובים ביותר רצים על חלונות. רוב הדרייברים של המצלמות דווקא סגורים. אבל לרוב יש גרסאות לינוקס, Raspberry PI ועוד.

עכשיו, בצילום אסטרונומי יש נדבך חשוב שמעניין אותו במיוחד: Electronically Assisted Astronomy או EAA בקיצור. פירושו ביצוע כל הפעולות הנדרשות לצילום (כולל עיבוד, איסוף תמונות והערמה) בזמן אמת, כאשר עם כל תמונה חדשה של האובייקט, אתה מקבל את התמונה הסופית המשופרת יותר ויותר. המטרה של EAA בניגוד לצילום, לא להגיע לתמונה הטובה ביותר אפשרית, אלא להגיע לתמונה שמספיק טובה כדי לראות את האובייקט ולהנות ממנו.

למעשה, במקום לצפות באובייקט דרך עינית, צופים בו דרך המסך. ובניגוד לצילום אסטרונומי שיכול להמשך שעות ארוכות, מסתפקים בזמן איסוף כולל קצת יחסית - מעשרות שניות עד דקות בודדות - כי המטרה לראות ולעבור לאובייקט מעניין הבא. מה מצב התוכנה פה? אם בצילום היה מאתגר בלינוקס, פה המצב קשה. יש מעט מאוד פתרונות ולא כולם עובדים ונוחים.

הבעיה השניה, מבחינתי, זה ש־EAA דורשת לרוב להביא מחשב נייד לשטח כדי להפעיל את כל התוכנה המסובכת הזו. למעשה, אם תצפיתן שצופה ויזואלית יכול להביא איתו תיק אחד ובו טלסקופ, חצובה וכמה עיניות, צלם צריך להביא איתו לשטח: חצובה ממונעת, עשרות כבלים, מחשב, ספק כוח שיספיק למספר רב של שעות ועוד. הקמה וקיפול של הציוד לצילום יכולים לקחת בקלות בין חצי־שעה ולשעה בניגוד לצופים בעין - העושים הכל במספר דקות בודדות.

אבל לרובינו יש כבר מחשב די חזק ונייד: טלפון או טאבלט! לו רק יכולתי לחבר את המצלמה ישירות לאליהם...

אז הרמתי את דגל

בניתי פתרון ל־EAA עבור לינוקס ואנדרואיד ושמו OpenLiveStacker. והוא בנוי בצורה הבאה:

  • הקוד כתוב ב־C++‎ עם שימוש ב־OpenCV לצורך עיבוד תמונה
  • הממשק בנוי כ־web interface שמדבר ב־REST עם השרת - מה שמאפשר בניית ממשק בלינוקס ואנדרואיד באותה צורה וגם מקל על גישה מרחוק במקרה והתוכנה רצה על pi. כמובן שהשרת מבוסס CppCMS. מה שמאפשר חיבור קל ונוח בין הקוד שדורש ביצועים הגובהים לממשק משתמש.
  • הדרייברים נטענים דינאמית:
    • אחד עבור מצלמה גנרית עם פרוטוקול UVC על בסיס libusb/libuvc- שתומך במצלמות רשת או במצלמות כמו SVBony sv105 - אבל הוא מוגבל לצורכים אסטרונומיים
    • דרייבר של ASI ZWO - החברה המובילה בתחום, שעובד מול SDK שלהם. לצערי הדרייבר עצמו הוא קוד סגור, אבל יש להם גרסה לאנדרואיד.
    • דרייבר גנרי שיודע לקרוא קבצים מהספרייה איך שהם מגיעים - מה שמאפשר חיבור לכל מצלמה אחרת דרך כלים קיימים כמו indi/ekos.
  • לצורך תמיכה באנדרואיד יש אפליקציה קטנה שעוטפת את השרת ומנהלת גישה ל־USB (כי באנדרואיד הכל צריך להיות מסובך)
  • לצורך הקלה על התמצאות יש חיבור לתוכנה פופולרית מאוד בתחום אסטרונומיה: ASTAP שיש לה גם גרסה (קובץ ריצה) לאנדרואיד. הדבר המעניין בתוכנה הזו שהיא כתובה בפסקל! לא חשבתי שאתקל בדבר כזה בימינו.

מה למדתי?

  • בניית אפליקציות אנדרואיד זה די סיוט וזה לא בגלל השפה אלא בגלל שצריך ללמוד פחות או יותר הכל מ־0. מזל שרוב הקוד ניתן לכתוב ב־C++‎.
  • כמעט כל דבר באנדרואיד עובד "קצת שונה". למשל: אין לך ‎/tmp, להריץ exe חיצוני זה סיפור שעלה לי בלילה לבן, להביא קבצים עם אפליקציה זה גם לא משהו טריוויאלי. בקיצור. זה לינוקס, אבל לא בדיוק.
  • אני שונא לעבוד עם קוד סגור. אומנם ASI ZWO משחררים דרייברים לאנדרואיד, אבל הם גם הכניסו באג מעצבן שגורם ל־RTTI לא לעבוד! למעשה כל תכנת החיבור ל־SDK שלהם כתבתי ב־C+-‎ בגלל אי זמינות של RTTI. וזה לא היה משהו מסובך אם הייתי יכול לקמפל את הדרייבר מחדש הבעיה הייתה פשוט נעלמת.

שורה תחתונה

אבל מה שחשוב, שבשורה תחתונה, יש לי פתרון פשוט - לעבוד עם טאבלט שבקושי צורך חשמל, קל ונוח.

הטקסט המלא

12 April, 2023 09:45 PM

04 April, 2023

Meir Kriheli

היכרות עם Rusmux

Tmuxinator הוא כלי אשר שימש אותי זמן רב. rusmux הוא תחליף שכתבתי ב־Rust.

04 April, 2023 01:35 PM

03 April, 2023

Guy Rutenberg

Install GNOME 44 on Debian Unstable

GNOME 44 recently got released. Because Debian Bookworm is undergoing a freeze, GNOME 44 is not yet available in Debian Unstable. It’s very similar to the GNOME 40 situation 2 years ago. While the wait for the freeze to be over can take a long time, Debian already has (most) of the updated pacakges in the experimental, and we can update to GNOME 44 through it:

$ sudo apt install -t experimental baobab eog evince gdm3 gjs gnome-backgrounds gnome-calculator gnome-characters gnome-contacts gnome-control-center gnome-disk-utility gnome-font-viewer gnome-keyring gnome-logs gnome-menus gnome-online-accounts gnome-remote-desktop gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-software gnome-system-monitor gnome-text-editor gnome-user-docs mutter gnome-desktop3-data
$ sudo apt-mark auto baobab eog evince gdm3 gjs gnome-backgrounds gnome-calculator gnome-characters gnome-contacts gnome-control-center gnome-disk-utility gnome-font-viewer gnome-keyring gnome-logs gnome-menus gnome-online-accounts gnome-remote-desktop gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-software gnome-system-monitor gnome-text-editor gnome-user-docs mutter gnome-desktop3-data

03 April, 2023 06:58 PM

21 March, 2023

Guy Rutenberg

Protecting OpenSSL private keys using PKCS#8

When generating private keys with OpenSSL, by default they are unprotected by a passphrase. For example:

$ openssl genrsa
-----BEGIN PRIVATE KEY----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCY+q1kOPM4RF5T
...
Rjet4T2TrJmFzIL1dsgJACU=
-----END PRIVATE KEY-----

generates a plaintext private key. By using the -aes256 parameters, the generated key is protected according to PKCS#8:

$ openssl genrsa -aes256
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFLTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQITQpYPEgrGN0CAggA
...
XIdi3hSPE8NoPWnROVGMnGbFOMm36g6064nZzQBD4r+4
-----END ENCRYPTED PRIVATE KEY-----

However, is it actually secure?

The default protection used by genrsa is PBKDF2 with 2048 (0x800) iterations of HMAC-SHA256. This can be verified by examining the PKCS#8 key, which is ASN.1 encoded.

$ openssl asn1parse -in key.priv 
    0:d=0  hl=4 l=1325 cons: SEQUENCE          
    4:d=1  hl=2 l=  87 cons: SEQUENCE          
    6:d=2  hl=2 l=   9 prim: OBJECT            :PBES2
   17:d=2  hl=2 l=  74 cons: SEQUENCE          
   19:d=3  hl=2 l=  41 cons: SEQUENCE          
   21:d=4  hl=2 l=   9 prim: OBJECT            :PBKDF2
   32:d=4  hl=2 l=  28 cons: SEQUENCE          
   34:d=5  hl=2 l=   8 prim: OCTET STRING      [HEX DUMP]:EAD8B97C8EAD1414
   44:d=5  hl=2 l=   2 prim: INTEGER           :0800
   48:d=5  hl=2 l=  12 cons: SEQUENCE          
   50:d=6  hl=2 l=   8 prim: OBJECT            :hmacWithSHA256
   60:d=6  hl=2 l=   0 prim: NULL              
   62:d=3  hl=2 l=  29 cons: SEQUENCE          
   64:d=4  hl=2 l=   9 prim: OBJECT            :aes-256-cbc
   75:d=4  hl=2 l=  16 prim: OCTET STRING      [HEX DUMP]:290DB8F1786A9C8667829A4A394A8FB7
   93:d=1  hl=4 l=1232 prim: OCTET STRING      [HEX DUMP]:D828C11F170D22B82801A567A9136AA293D630692B88C1F07987ED256C29DC45C4625709A0D36039B22E5A8BCA2B400C590C2560CED3629D1F8C5D77AD...CC5F8027A3A5ED533A00D626E7DDC4ABC85547

A meager 2048 SHA256 iterations provide very little added protection on top of the password intrinsic entropy.

Better protection can be achieved by using scrypt to protect the PKCS#8 encoded key. You can upgrade an existing key’s protection to scrypt:

openssl pkcs8 -in key.priv -topk8 -scrypt -out key-scrypt.priv

The command will prompt for the key’s passphrase and re-encrypt it using a key derived from the same passphrase using scrypt.

openssl pkcs8 -in key3.priv -topk8 -scrypt -out key5priv

The default openssl scrypt parameters, N=0x4000=2^14, r=8, p=1, are simply weak. They are what scrypt’s author recommended to achieve 100ms per iteration on his 2002-era laptop. While better than the PBKDF2 protection offered by OpenSSL, you might want stronger protection.

Choosing better scrypt parameters

Before we dive into the parameters, let’s understand the scrypt algorithm briefly. Scrypt takes three input parameters: password, salt, and cost parameters. The password and salt are user-provided inputs, whereas the cost parameters are fixed for a given implementation.

The cost parameters determine the computational cost of the algorithm. Higher cost parameters result in increased computational requirements, making it harder to brute-force the derived key. The cost parameters are as follows:

  • N: This is the CPU/memory cost parameter. It determines the number of iterations the algorithm performs. The value of N must be a power of two.
  • r: This is the block size parameter. It determines the size of the blocks of memory used during the algorithm’s execution.
  • p: This is the parallelization parameter. Doesn’t affect the memory consumption of the algorithm. However, despite it’s name, OpenSSL doesn’t perform any parallelization, instead opting to run the algorithm serially.

The original article recommends r=8 and p=1 as a good ratio between memory and CPU costs. This allows us to scale N almost arbitrary, increasing both CPU and memory costs. However, OpenSSL, by default, limits it’s memory usage.

$ openssl pkcs8 -in key.priv -topk8 -scrypt -scrypt_N 0x8000 -out key-scrypt2.priv
Enter pass phrase for key.priv:
Error setting PBE algorithm
40E778DD277F0000:error:030000AC:digital envelope routines:scrypt_alg:memory limit exceeded:../providers/implementations/kdfs/scrypt.c:482:
40E778DD277F0000:error:068000E3:asn1 encoding routines:PKCS5_pbe2_set_scrypt:invalid scrypt parameters:../crypto/asn1/p5_scrypt.c:59:

This limitation severely our parameters choice. The only option to increase security, is through the CPU cost parameter (p). We can set it (almost) arbitrary large, getting added security. For example:

$ openssl pkcs8 -in MOK.priv -topk8 -scrypt -scrypt_p 32 -passin pass:1234 -passout pass:1234 -out key-scrypt3.priv

21 March, 2023 06:57 PM

26 February, 2023

Boris Shtrasman

כותב על תוכנה חופשית, תוכן חופשי, או סטנדרטים חופשיים ? צרף את הפיד שלך לפיד המקור כך כולנו נלמד ממך.

לפני זמן מה מישהוא הדליק את הלפיד, בנתיים יש הרבה מקומות בהם לא רואים את האור של הלפיד ההוא.
 
מפה לשם הכתובת להוספת אנשים השתנתה (אפשר לבקש מהמקור), אבל הרעיון עדיין חי ובועט.
 
אז אנשים טובים ורבים כותבים פוסטים בבלוגים שלהם וגם בטוייטר שלהם על תוכנה חופשית , על לינוקס, על קוד פתוח , ועוד דברים קשורים הרבה פעמים יוצאים להם פוסטים מדהימים ששווה שיגיעו לאגרטור של התוכנה החופשית העברית.

כמעט כל מערכת בלוגים יש לה ייצוא rss או atom, לכם הכותבים המקומיים על התוכנה החופשית יש עוד מקום נחמד שקיים כבר שנים רבות. זה הוא הפלאנט של עמותת המקור. 

planet.hamakor.org.il. 
 
לוקחים את פיד ה RSS (או ATOM או אחרים) מבקשים להצטרף לפלאנט והופ גם אתם שם.

למי שמשתמש ב write freely מה שצריך לעשות זה לקחת את הדומיין שקיבלתם ולהשתמש ב feed תחתיו. לדוגמה : 
user.domain.tld/feed אם הדומיין שלכם הוא user.domain.tld.
 
בוורדפרס ובלוגר צריך להפעיל את הפיטצ'ר ידנית.

במקור נאמר :

זאת הזדמנות טובה להזכיר שהפלאנט פתוח לכל מי שכותב על תוכנה חופשית, ואשמח לצרף כמה שיותר אנשים. בסופו של דבר המטרה היא לרכז במקום אחד את מה שכותבי חברי קהילת התוכנה החופשית בארץ ובכך לעודד החלפת של רעיונות ודיעות בנושאי תוכנה חופשית.

 

 

26 February, 2023 01:26 PM

18 February, 2023

Diego Iastrubni

שידרגתי את השרת הזה

לפני

[email protected]:~# cat /etc/debian_version  
10.13

אחרי:

[email protected]:~# cat /etc/debian_version  
11.6

השרת Next cloud אצלי גם שודרג מגרסה 23 אל 25 – וזה היה האתגר לשינוי. אני צריך את האפליקציה הזאת ב־next cloud והיא לא הייתה זמינה. גם לא קיבלתי עדכונים – כי גרסת php שלי הייתה נמוכה מדי..

השידרוג של דביאן היה פשוט. רק עדכנתי את /etc/apt/sources.list ואז עשיתי

apt dist-upgrade --auto-remove --purge

הבעייה היחידה שלי הייתה בהגדרות של nginx שבה הייתי צריך לשנות מיקום של php-fcm socket (היה טריויאלי).

לעומת זאת – שידרוג של next cloud כרגיל מאוד לא ישיר (קפצתי שתי גרסאות, וזה אומר לבצע שני שדרוגים..) ואחרי כל אחד מהם ללכת לשורת הפקודה ולייצר אידקסים של בסיס נתונים (occ עושה את זה…) ואז לאט לאט להשתיק את ההמצלות שלו… מעניין אם זה מעיק בכוונה תחילה.

הטקסט המלא

18 February, 2023 03:12 PM

29 January, 2023

Ira Abramov

הפידרציה הגיעה לבלוג

לא יודע מתי תקראו את זה בעתיד, אבל פעם הייתה רשת חברתית סגורה אבל חביבה עלי בשם טוויטר. בא איש אחד בשם מאסק וקלקל אותה ופרחה לה בחזרה רשת מבוזרת כמו בימים הטובים של התחלת האינטרנט. מסטודון היה קילר אפפ שהופיע בדיוק בזמן לקלוט את חובבי המיקרובלוגינג שברחו מטוויטר וטאמבלר וצירף אותם לרשת סטטוסנט/אקטיביטי פאב שכבר כללה כמה תוכנות ניהול נוד רשתי (המקבילה של שרת דואר ברשת SMTP או שרת IRC וכולי). עכשיו אפשר לקרוא את הפרסומים שלי בתור הודעות ברשת הזו בזכות תוסף וורדפרס.

אז אם אתם מחפשים אותי כי לטוויטר אני נכנס פחות ופחות, אני @I

שרתי אקטיביטיפאב בעברית (מתוך אלפים שהוקמו) הם נכון להיום בעיקר על בסיס מסטודון אבל לא רק:

ועוקב אחרי כולם אתר פיד עברי.

בקיצור, בעוד רגע אלחץ פה על "פרסום" והפוסט יופיע פה. יאללה, תעקבו, נראה מה זה שווה?

29 January, 2023 04:52 PM

03 January, 2023

Meir Kriheli

מצגת ההרצאה HTML over the wire

הרצאה אודות htmx והצורך בפתרונות כאלה במסגרת PyWeb-IL 101.

03 January, 2023 03:46 PM

19 December, 2022

Omer Zak

Convert Apache2.4 configuration and rewrite rules into Nginx configuration

Those days I am moving my website from Apache2.4 to Nginx.

So I googled for “convert apache rewrite to nginx”. I found the folllowing articles:

In addition to the aforementioned articles, I found the following SaaS services for converting Apache2.4 configuration files into Nginx configuration files.

I recommend that you run your conversion in both winginx.com and getpagespeed.com, review and edit the resulting Nginx configuration file.

19 December, 2022 12:44 PM

13 December, 2022

Hetz Ben Hemo

סידורים אחרונים – וסוגרת את הבסטה הזו

את הבלוג הזה אני כותבת שנים רבות (כולל גירסת הארכיב) – עוד משנת 2006 (עוד מהימים שהנאיביות שלי היתה בשיאה…). כתיבה בבלוג הזה עזרה לי ולאחרים מבחינת שיתוף מידע, מבחינת עבודה ומבחינות נוספות, ואם מאן דהו ישאל אותי איך הוא יכול לקבל חשיפה יותר גדולה בשביל העסק שלו או בשביל עצמו – אני עדיין יאמר שבלוג הוא פתרון מעולה, אם כי כדאי לחשוב גם על אופציות כמו יוטיוב ואולי אפילו אינסטגרם או טיקטוק, תלוי בתחום..

הגעתי למצב שבו יש לי בכל זמן נתון כ-9 בלוגים שאני מתחזקת, חלקם פתוח לציבור וחלקם מיועד לסקטורים מסויימים והתוכן לא זמין, ולכן החלטתי להתחיל לאחד דברים כך שאוכל להקדיש את זמני הפנוי לתכנים בכמות קטנה של ערוצים, ולהלן הסדר החדש:

ערוצי יוטיוב

אני מודה כי בעבר עשיתי סלט שלם מבחינת קליפים ומיקומם בערוצים השונים, ולכן גם כאן דברים ישתנו:

לסיכום: ערוצים ירדו, ערוצים אחרים יעודכנו, ואתם תוכלו לפי הדברים שמעניינים אתכם – לקבל את המידע ממני בכמות קטנה של אתרים וערוצים.

ברצוני לנצל הזדמנות זו בכדי להודות לכל הקוראים והמגיבים והמשתתפים. בלעדיכם – זה לא היה קיים, ולכן – תודה לכם 🙂

הטקסט המלא

13 December, 2022 12:17 PM

11 December, 2022

Omer Zak

Cheatsheet for doing rsync for archiving

# -avHAX:
# -a = archive (equivalent to -rlptgoD)
#      -r = recurse into directories
#      -l = copy symlinks as symlinks
#      -p = preserve permissions
#      -t = preserve modification times
#      -g = preserve group
#      -o = preserve owner (requires sudo)
#      -D = --devices --specials
#           --devices = preserve device files (requires sudo)
#           --specials = preserve special files
# -v = verbose
# -H = preserve hard links
# -A = preserve ACLs
# -X = preserve xattrs
#
# Before actual work, you may want to use --dry-run.
sudo rsync -avHAX --progress --exclude-from=- $SRCDIR $DESTDIR <<EOF
- /temp/***
- /trash_script.sh
EOF

11 December, 2022 08:13 PM

Diego Iastrubni

שעונים חכמים חופשיים

בעבר רציתי שעון חכם וקניתי שעון חכם שתומך ב־AsteroidOS. זה התברר בתור דבר פשוט מיותר… והחלטתי למכור את השעון. אני לא ממליץ על המערכת הפעלה הזאת, היא פשוט לא טובה.

אז יש בחור שהתחיל לעשות מכשיר חכם מאפס מאפס. קוראים לו פאול.

המיזם זמין בכתובת https://open-smartwatch.github.io . יש תרשימים סכימטים, קוד למערכת ההפעלה, קבצים למדפסות תלת מימד ועוד. יש גם חנות שבה אפשר לקנות את החומרה מוכנה – https://www.makerfabs.com/open-smartwatch.html . אני לא ממליץ – זאת הגרסה הראשונה שנראית מגעילה. הגרסה השקופה, בצבע שחור נראית לי הכי יפה, אבל גם הגרסה הלבנה (הדקיקה עם המסך ה”רגיל”) נראית משהו בהחלט שמיש.

רב התיעוד שמצאתי נמצא בווידאו הזה: https://www.youtube.com/watch?v=a6kkrQ26h_4 . נראה שפשוט צריך לבנות את הדבר הזה בעצמך נכון לעכשיו, זה מצריך גישה למדפסת תלת מימד בשביל המארז עצמו, להזמין כמה חלקים מדוד עלי, כלי הלחמה וסבלנות. חומרי הגלם עולים בערך 300₪. אם מישהו קונה ורוצה לבנות לי אחד – צרו קשר!

הטקסט המלא

11 December, 2022 08:02 PM

22 November, 2022

Gabor Szabo

Promotion: Getting my content in-front of more people

For the full article visit Promotion: Getting my content in-front of more people

22 November, 2022 06:41 AM

21 November, 2022

Gabor Szabo

Interns for Open Source projects

For the full article visit Interns for Open Source projects

21 November, 2022 03:50 PM

03 November, 2022

Artyom Beilis

התקדמות חשובה בתמיכה ב־OpenCL ב־pytorch.

רקע

היום pytorch היא אחת התשתיות המובילות בעולם למידה עמוקה. יש לה יתרונות רבות, אבל מבחינת המפתח זה קוד איכותי ותיעוד טוב. הקוד כתוב בצורה מאוד מודרנית עם שימוש נכון ביכולות C++‎ מה שמאוד מקל על הפיתוח. אני עובד בתקופה האחרונה על פיתוח מנוע עבור pytorch מבוסס OpenCL כחלופה ל־cuda.

כבר כתבתי בעבר על חשיבות התמיכה ב־OpenCL.

אבל בכל זאת אזכיר כמה נקודות מבחינת קהילת תוכנה חופשית וקוד פתוח:

  1. אנחנו זקוקים בתמיכה חוצת פלטפורמה בכרטיסי מסך מיצרנים שונים כמו AMD, Intel וכמובן nVidia.
  2. אנחנו זקוקים למימוש האלגוריתמים המרכזיים כקוד פתוח הזמין לכל (ולא כקופסה סגורה ש־nVidia נותנת)
  3. אנחנו רוצים לעבוד עם סטנדרטים פתוחים וזמינים כמו OpenCL ולא מימושים ספציפיים של יצרן (כמו cuda).

הפרוייקט ב־github‏

אז מה חדש? קלות אינטגרציה!

עם שחרור גרסה 1.13 של pytorch חל שיפור משמעותי ב־out-of-tree-backend. עכשיו הוספת מנוע אימון מבוסס OpenCL היא פשוטה מאוד ולמעשה שאלה של מספר דקות, אפילו בוונידוס העניין יחסית פשוט. המשמעות שאפשר להשתמש במנוע OpenCL בקלות רבה הן בלינוקס והן בווינדוס.

מה עם הביצועים? אם משווים מול גרסת cuda/cudnn על אותו ה־gpu מדובר בין 50 ל־70 אחוז ביצועי cuda באימון ובין כ־60 ל־80 באבלואציה (תלוי ברשת כמובן).

למרות שהמנוע עדיין ניסיוני וחסרים בו לא מעט פעולות הוא נבדק בהצלחה על עשרות רשתות כמו resnet, mobilenet ורבות אחרות.

המנוע עצמו מבוסס על ספריית dlprimitives‏ שאני מפתח במקביל והיא חלופה ל־cuDNN על בסיס OpenCL וגם מנוע חיזוי שעובד עם מודלים בפורמט ONNX - שזה נושא גדול בפני עצמו.

מה המשמעות של זה?

  • משתמשי AMD יכולים לאמן רשתות. הם לא מוגבלים למספר מצומצם של דגמים ש־rocm תומך בהם או לשימוש בלינוקס בלבד. התמיכה היא גורפת מ־APUים ישנים כמו Stoney Ridge ועד ל־RDNA 2 וגם זה עובד על "חלונות" למי שמעוניין.

    זו הייתה משימה כמעט ובלי אפשרית עד היום. עכשיו זה במרחק מספר פקודות

  • תשתית אימון היא קוד פתוח לגמרי גם אם עובדים עם nVidia (טוב חוץ מהדרייבר שלהם)

  • כל מה שצריך זה דרייברי של OpenCL. לא צריך את כל המפלצת של cuda (מי שיצא לו להתקין לשדרג לגלות בעיות תאימות יבין אותי מידי)

מחפש עזרה...

מישהו יודע איך אפשר לבנות ולפרסם whl לפלטפורמות שונות? רצוי איזה שירות ענן שיעשה זאת? כדי שזה יהיה ממש במרחק של pip install :-)

הטקסט המלא

03 November, 2022 10:31 AM

02 November, 2022

Kaplan Open Source Consulting

כנס GIS בקוד פתוח למגזר הציבורי

כנס GIS בקוד פתוח 2022 למגזר הציבורי, נובמבר 2022

כנס GIS בקוד פתוח חושף את המגזר הציבורי לפתרונות הקיימים וליוזמות של גופים מקבילים. הדוברים/ות בכנס יציגו מגוון רחב של פרויקטים העושים שימוש בכלים השונים.

בשנים האחרונות אנחנו רואים מגמה של אימוץ GIS בקוד פתוח על ידי גופי ממשלה וגופים מוניצפאלים רבים, זאת בין היתר בעקבות האתגרים שהציבה מגיפת הקורונה לצד יתרונות טכנולוגיים ועסקיים בנושאי הסרת מגבלות רישוי תוכנה.

בכנס נדבר על מהו GIS בקוד פתוח והרלוונטיות לתפקידים שונים ברשויות המקומיות, וכיצד איך הוא בא לידי ביטוי בגופי הממשלה. מה ההבדל בין קוד פתוח למידע פתוח ואיך פותחים את המידע לציבור בצורה הנכונה. נציג פרוייקטי GIS שנעשו בזכות פתיחת מאגרי מידע לציבור.  נראה גם יוזמות ממשלתיות בנושא מעקב והנגשת מידע אודות תחבורה ציבורית, כולל יכולת תחקור עבור כל הרשויות בארץ. כל אלה לצד היתרונות של קוד פתוח במעבר לענן הממשלתי (נימבוס).

מתי: רביעי, 9.11.22 9:00-13:00

מיקום: תל-אביב  או בזום (לבחירתכם)

הרשמה בקישור: https://forms.gle/b18bbnKm8xbUKdxJ6

ההשתתפות ללא תשלום, אך יש להירשם מראש.

עדכונים על כנסים וארועים נוספים הרשמה לניוזלטר 

02 November, 2022 03:08 AM

28 September, 2022

Hetz Ben Hemo

הטעות של רד-האט בנושא תמיכה במקודדי וידאו

אחד הדברים המבורכים בהפצות לינוקס – זו היכולת לקרוא את הדיונים לגבי שינויים שנעשים בהפצות לינוקס, דעות, בעד ונגד. במקרים רבים ישנם החלטות ודיונים פנימיים, אולם בד"כ התוצאות של הדיונים יוצאות בהודעה מסודרת ב-Mailing List הרלוונטי.

דיון מעניין שחל אתמול קשור להפצת Fedora ולהחלטה לבטל כל האצה של קידוד או פריסת וידאו בהפצת הלינוקס ברמת תשתית כברירת מחדל. במילים אחרות: אם מאן דהוא יפעיל מצלמת Webcam ברזולוציית 1080P והוא ינסה להקליט את הוידאו (לדוגמא עם תוכנה כמו OBS Studio) – סביר להניח שהוא ימצא את התוצאות בלתי מספקות. אם הוא ינסה לנגן וידאו שמקודד ב-H.264 או HEVC או VC1, סביר להניח שבקטעי האקשן, הוא יקבל דילוגים ו"נפילות" (Dropped) בפריימים כך שהתוצאה לא תיראה טוב.

סביר להניח שמי שישתמש בהפצת הלינוקס וידע לינוקס, ימצא בסופו של דבר כי יש צורך להוסיף REPO שנקרא rpmfusion וממנו יהיה צריך להתקין חבילות של Mesa בהתאם לכרטיס הגרפי שיש במחשב/בלאפטופ (החבילות כיום עדיין אינן קיימות, למיטב ידיעתי). משתמשים חדשים לעומת זאת, שהחליטו לנסות את פדורה, יצטרכו לחפש איזה "מדריך" או איזה פוסט בבלוג כלשהו שיסביר להם מדוע יש את הבעיה ואיך לתקן אותה – לכשהם יתקלו בבעיה.

מדוע בכלל הבעיה הזו קיימת? (כפי שניתן לראות בדיון הזה, העובדה שהחבילות יצאו עם Hardware Acceleration היא בכלל באג שעכשיו "תוקן" ושישבית כל האצה) – התשובה לכך פשוטה: פחדים עלומים של רד-האט מתביעות לגבי פטנטים ותמלוגים, דבר שלא קרה כבר יותר מ-30 שנה בהפצעות לינוקס.

מכיוון שכותבת שורות אלו ייעצה בעבר לחברות שונות בקשר לפתרונות מולטימדיה ועבדה מול עורכי דין וארגוני Patent pools שונים, אז אני מכירה את הנושא די טוב וחשבתי בפוסט זה לפשט ולהסביר את הדברים בכל הקשור לפטנטים ותשלומים.

כפי שתוכלו לראות בכל מיני אתרים – ארגון ה-MPEG LA (שהוא בעצם "ארגון" שדואג למכירת רשיונות למקודדי וידאו ואודיו שונים, גביית תמלוגים, תביעת מפירים וכו') לא ממש "רודף" אחרי נגנים מבוססי קוד פתוח. הארגון מעולם לא תבע את KODI (תבעו את KODI על דברים אחרים, לא על Codecs), או את VLC או את FFMPEG או OBS Studio או כל תוכנת ניגון ו/או עריכת אודיו וידאו מהסיבה הפשוטה שזה לא שווה להם – הן מבחינת יח"צ, הן מבחינת גביה ממשית והן מבחינת רווח סופי כלשהו. (חריגה אחת היתה, למיטב זכרוני, כאשר Dolby Labs ביקשו ממפתחי החבילה ac3dec להפסיק להשתמש במינוח "AC3" מכיוון שמדובר בסימן רשום. מאז פג תוקף למושג, כך שדולבי ירדו מהעניין).

הארגון כן "רודף" אחרי יצרנים של מוצרים סופיים (בין אם הם משתמשים בפתרונות מבוססי קוד פתוח או סגור). אם לדוגמא חברה מייצרת טלפונים או טאבלטים, והיצרן רוצה לכלול קידוד או פריסה (Encode/Decode) של אודיו או וידאו עם מקודדים מסויימים, אז אותה חברה תסגור רשיון עם MPEG-LA שבו יפורטו סוגי הרשיונות (יש כמה, לא רק סוגי codecs), האם זה יכלול רק פריסה, רק קידוד או גם וגם, וכמובן סוגי Codecs. דוגמא פשוטה: חברת Lenovo מייצרת טאבלטים וטלפונים זולים, רוב המכשירים מהסוגים הנ"ל כוללים תמיכה של פריסה וקידוד במקודד H.264 אך רובם אינם כוללים תמיכה בפריסה וקידוד במקודד HEVC (זה סגור ברמת חומרה), כך שלנובו משלמת רק על H.264, לא על השאר.

אם נתרגם את זה למציאות: אם מחר אבנה נגן מבוסס Raspberry Pi שיריץ KODI ואמכור זאת כמוצר סופי, סביר להניח ש-MPEG LA יצרו קשר ויבקשו תמלוגים (ואם לא אשלם – אתבע).

בתחום מערכות ההפעלה השונות, המצב שונה. מיקרוסופט מבקשת בחלק מהמקרים מהמשתמש לרכוש לדוגמא רשיון HEVC במחיר של $1. הסיבה? מיקרוסופט נותנת מספר כלים לתצוגה ועריכת וידאו עם תמיכה ל-HEVC ורשיון Windows אינו כולל רשיון ל-encode (קידוד) בכלים שמיקרוסופט נותנת, ולפיכך דרישת התשלום (לא תופיע דרישת תשלום אם מדובר רק בניגון וידאו, לדוגמא).

בכל הקשור לניגון וידאו – יש כבר מי שמשלם את רשיון ה-Codec והוא – יצרן ה-GPU במחשב, ובדרך כלל אותו יצרן גם כותב את התמיכה להאצת ה-codec ברמת הדרייבר גם בלינוקס, כך שאין כאן צורך תשלום כפול כלשהו לניגון הוידאו, ורד-האט יכולה להתנהג בדיוק כמו מיקרוסופט (שגם היא לא משלמת על מקודדים לצרכי ניגון מדיה), אולם לצערי רד-האט לוקחת צעד אחד רחוק-מדי, ועוצרת את תמיכת הקידוד/פריסה עוד ברמת התשתית (Mesa), אפילו לא ברמת הנגן, דבר שאף אחד לא עושה ואינו נדרש מצד שום גוף רשמי כלשהו, למיטב ידיעתי.

לסיכום: רד-האט היא חלק מחברת IBM, חברה בעלת מיליוני פטנטים (גם בתחום האודיו ו-וידאו, אגב), וחבל שברד-האט לא מנסים לבדוק את העניין לעומק ובמקום זאת מקשים על משתמשים חדשים בלי שום סיבה רצינית.

הטקסט המלא

28 September, 2022 05:03 PM

14 June, 2022

Arie Skliarouk

O GTalk team, where were thou? (part IV: The END)

It is finally happened:


Google Talk is surprisingly still operational, but that ends on Thursday

Took 12 years to die:

O GTalk team, where were thou? (part III) (AKA: The other shoe dropped). (2017)

O GTalk team, where were thou? (part II) (2014)

O GTalk team, where were thou? (2010)

14 June, 2022 05:09 AM

01 June, 2022

backup and restore with duplicity

Duplicity backup utility is the old workhorse in all recent Ubuntu versions. I use the GUI called Deja-Dup for quite a while now. But until now I never bothered to check how to restore my files. I did decide to check how to restore file, because backup is only half the job! It turns out, that the GUI does a disservice for duplicity users. Restoring an encrypted backup turned out to not work. I didn't bother to research why, and turned to the CLI. This is a reminder on how to restore the files. continue reading...

01 June, 2022 01:49 PM

I am on Github sponsors now

This already happend a while ago. I am on Github Sponsors and you can support my opensource work. continue reading...

01 June, 2022 01:49 PM

Announce - CoreDNS Netbox Plugin v0.2, now with IPv6

I just released the 2nd version of my CoreDNS plugin for getting DNS records from Netbox. This release adds IPv6. continue reading...

01 June, 2022 01:49 PM

Announce - Wolkenbrot v0.3 - now with OpenStack support

I have just released WolkenBrot v0.3 with OpenStack support. WolkenBrot is my own little program to bake cloud images. The name means "Cloud Bread" in German. continue reading...

01 June, 2022 01:49 PM

Using IPython Notebook on Linux Machines in the Enterprise Corp.

A short guide for using IPython and Jupyter Notebook on remote Linux machine in the Enterprise Corp, where you don't have root rights. continue reading...

01 June, 2022 01:49 PM

blogit - new release

After a long development hiatus I am releasing a new version of blogit continue reading...

01 June, 2022 01:49 PM

Visualize almost anything with Grafana and Python

This is a short tutorial on how to build a data source for Grafana using Python Bottle micro-framework. Eventually, you can use this code to connect to any database (including SQLite). continue reading...

01 June, 2022 01:49 PM

Fooling around with JavaScript and OpenPGP

Fooling around with JavaScript and OpenPGP, as the title says. I needed to create a page in which I can encrypt files with OpenPGP. Doing this with JavaScript turned out to be possible. These are the results of my experiment. continue reading...

01 June, 2022 01:49 PM

Thoughts after leaving noris network after two years

After two years at noris network AG, yesterday was my last day with this company. It has been a long time since it felt so hard leaving a company. In my two years I worked with really great people on some of the most cutting edge technologies. All these things were not possible without the help of so many great people with whom I worked with. Some of them might read this post, so here is a big thanks. I wanted to summerize my two years and gather all the lessons I learned in one place for my future self and others too. It's quite hard summerize such an eclectic post. It's been a wild ride in noris network with lots of new technologies and ideas. We have had a lot of success. I would like to think that a great part was because we opted to work in an open source matter, even thougah not all our projects where open source. This blog post is a summary of the good things we did, and the positive leasons we learned. I hope reading through these will inspire you to choose a similar path. continue reading...

01 June, 2022 01:49 PM

23 March, 2022

Guy Sheffer

Pi Imager – community managed fork of rpi-imager

Pi Imager logo

Hey all,

I have started to maintain a fork of rpi-imager called Pi Imager. The main goal of it is to have a place to host images for anyone who wants their images downloaded and flashed with a single tool. There are already 7 extra distributions you can flash on the unofficial imager and I hope with this post this number will grow.

The changes to the official imager are:

  1. There is an unofficial category that has images you can’t get on the official imager. You can submit a pull request to this repository and add yours.
  2. Everything is automatic. You can fork it, make your own commits, and you have a working build system –
    • Every new commit to pi-imager builds a new build for Windows, Mac and Linux, ready to use
    • When you ask to add a new image and the pull request is accepted, it’s added to the global list automatically
  3. There is a feature to disable username change that can be set on the distribution side. It broke stuff in OctoPi (currently in main branch).
  4. Appimage support for Linux (fixes this issue)
  5. Trademark and colors have been removed as requested by RaspberryPi, it’s purple now!

I want to stress that the fork is here to work with the community and not to split it, you can have both installed. I have been in contact with Raspberry Pi before and after its release. It lets us have something that they can’t provide – an unofficial place that with a single click downloads and flashes community-maintained images, and lots of them.

Code and image contributions are welcome!
Get Pi Imager here

Full text

23 March, 2022 05:00 PM

15 January, 2022

Ira Abramov

התדמית של עולם התכנה החופשית על פרשת דרכים

תוכנה חופשית היא דבר נפלא. אני מאוהב ברעיון כבר כ־28 שנה מאז גרקתי אותו לראשונה. ארגנתי קהילות ואירועים להפצת ידע על ואודות חופש התוכנה, ואי אפשר לזרוק היום אבן באף ענף כלכלי בלי להתקל בתוכנה חופשית רצה איפשהוא על שרת, עמדת חיוב כרטיסים בסופר וכמובן שכל האינטרנט וכל כיס מריצים תוכנות חופשיות למכביר. אין סטארטאפ שמתחיל היום בשוק וממציא לבד את כל הגלגלים, אם זה בתוכנה, ביולוגיה או כל תחום הנדסי, אתה תלוי בתוכנה, אם זה באסטרונומיה או מכונות CNC, תוכנה חופשית היא לפעמים החנות היחידה לשאוב ממנה את הכלים הדרושים למקצוע. מצד אחד אין להתעלם, ומהצד השני אין מנוס מלהשתמש. ההתנחלות הזו בלבבות וברשימות התלות של תוכנות היא חרב פיפיות, ובחודשים האחרונים אנחנו רואים כמה צרות שמאיימות על עתיד הקהילה.

אולי המכה הכי גדולה למוצר תוכנה היא נטישה שתוביל ל"רקבון ביטים". תוכנה שלא מתעדכנת לא מקבלת תכונות חדשות אבל גם לא נסתמות בה פרצות שמתגלות. אם יש לה עדיין משתמשים אז דברים ישברו, ובכל פעם שמשהו בעולם התוכנה החופשית נשבר ומשפיע על production של חברות מסחריות, התדמית נפגעת. לאחרונה אני רואה כמה ארועים שבאו ברצף:

תזוזה קטנה ועוד אחת, מתי נענועי הסירה יהפכו אותה? הפחד שלי היא לולאת משוב ענקית שבה פתאום חברות יפחדו להשתמש במוצרים חופשיים או לתרום להם, מה שיגרום לאיבוד רוח מהמפרשים של מפתחים מתנדבים. בנקודות כאלו כדאי לזכור שהמתנדבים לא ממש מקבלים הרבה גב, חלקם אפילו לא יודעים איך לשווק את הפרויקט או לקבל תרומות גם אם ירגישו שנכון להם לבקש. המקרים של מפתחים כמו מארק סקוויירס מדאיגים אותי מאוד: בוקר אחד קם אדם ואומר לעצמו שלא משלמים לו מספיק אז הוא יתקע לכולם מקל בגלגלים (אני אפילו לא יודע אם הייתה דרך למישהו לשלם לו לפני שהתחיל להשתולל). בתגובה לא בלתי מוצדקת נחסמו לו חשבונות אצל גיטהאב ו־pypi. יש לי כמה דברים לומר למפתחים שהחליטו לפרסם קוד ברישיון פתוח – ראשית ציינו בצורה ברורה מה תנאי הרשיון (אי ציון רישיון ברור מטילה עליכם את האחריות אם למשתמשים נדפק משהו, וברירת המחדל איננה "נחלת הכלל"), ושנית היו מוכנים שיהיו לכם הרבה משתמשים מסחריים. אם לא מקובל עליכם, אל תירו לעצמכם ברגל, פצלו את הפרויקט לגרסא פתוחה ואחת סגורה בתשלום או כל דרך אחרת. לדחוף קוד ששובר את הספריה שלכם מבטיח גם נטישה של משתמשים וגם איבוד האמון בכם לעתיד, וכמובן פותח פחת לתביעות משפטיות אם הרישיון שלכם לא מצוין נכון.

ורק כדי להיות ברור: יש המון חדשות טובות בקהילה הזו, הפחד שלי הוא מהתדמית בעיני משתמשים מסחריים, שהפכו לחשובים מאוד בתהליך הפיתוח של כלים קטנים לפעמים. הקרנל של לינוקס ופרוייקטים מסביבו עדיין חיים ותוססים ושיפורים קורים השכם והערב.

ומה הפתרון? אין לי תשובה. גם ככה הרשת שלנו הפכה בעשורים האחרונים לריכוזית מדי. כל הקוד העדכני בגיטהאב. כל הידע הטכני בסטאק אוברפלו. הרשת החופשית שהתאהבתי בה כמעט כבר לא קיימת, כשכל הידע והתקשורת קורים בין הכתלים של 10 חברות (אני נדיב) ולא בעשרות אלפי אתרים מבוזרים. אם מחר גיטהאב משנה תנאי רשיון, או סטאק אוברפלו פושטת רגל זו מכה רצינית מאוד לקהילת המשתמשים. אני למשל מחזיק בבית תלתפסת שכל הידע של קהילת המשתמשים שלה היה בגוגל פלוס, ויום אחד פשוט הוסר בלי יכולת לגבותו כראוי, ורק אחוז קטן ממנו שוחזר אח"כ לאתר עצמאי אחר.

מוזמנים לתת את דעתכם ופתרונותיכם פה בתגובות, רק אל תתחילו למכור לי בלוקצ'יין. דברים ישימים בלבד :)

15 January, 2022 04:44 PM

09 January, 2022

ik

מציאת רשומה לפי התחלה מדוייקת ב PostgreSQL

הנה בעיה מעניינת – כיצד אני מביא רשומה המתאימה ביותר להתחלה כלשהי, כאשר ההתחלה משתנה באורך/תווים שלה?

בשביל להיות פחות כללי, אציג את הבעיה כך:
יש לי קידומות של מספרי טלפון ואני צריך למצוא מי ספק הטלפון שמחזיק בקידומת הזו.

כאשר אני יודע כי 2 תווים ראשונים מחזיקים תמיד בקידומת הבעיה מאוד פשוטה – אני חותך 2 תווים ראשונים ומחפש עליהם קידומות בצורה חד חד ערכית, ואם מדובר ב unique index חיפוש מהיר ביותר שאולי יעשה sequence scan במקום חיפוש באינדקס ויהיה מהיר מאוד.

אבל כאשר חלק מהקידומות הן בעלות 2 תווים, חלק אחר בעלות 3 תווים ואפילו ישנן קידומות בעלות 4 או 6 תווים כאשר התו האחרון הוא זה שמבדיל בין ספקיות שונות יש בעיה.
הרי אין לי ידע מקדים מה הקידומת ומה הוא המספר עצמו.

למזלי יש כלים מאוד חזקים המסייעים בזה עם מסד נתונים PostgreSQL או PG בקיצור.

הדגמה של טבלת קידומות:

create table prefix_providers (
  prefix varchar(15) primary key not null,
  provider_name varchar not null
)

הנה קצת קידומות של ספקיות שהכנתי לצורך ההדגמה:

insert into prefix_providers values
('022', 'Paltal'), ('032', 'Paltal'), ('042', 'Paltal'), 
('082', 'Paltal'), ('092', 'Paltal'), ('0230', 'Hot'), 
('0231', 'Hot'), ('0330', 'Hot'), ('0331', 'Hot'),
('0430', 'Hot'), ('0431', 'Hot'), ('0830', 'Hot'),
('0831', 'Hot'), ('0930', 'Hot'), ('0931', 'Hot'),
('025', 'Bezeq'), ('026', 'Bezeq'), ('027', 'Bezeq'),
('028', 'Bezeq'), ('029', 'Bezeq'), ('039', 'Bezeq');

לא הזנתי את כלל המספרים עבור טלפונים נייחדים וכבר ניתן לראות את הבעיה, נכון?

מה הדרך שהייתם כותבים את השאילתא למצוא את הספק המדויק של מספר הטלפון 03987654321?

הדרך שלי היא לפרק את המחרוזת לסדרה של תווים כאשר כל איבר בסדרה מכיל גם את האיברים הקודמים פלוס עצמו. כלומר 0, 03, 039, 0398 וכו' עד להשארת המספר עצמו.
לאחר מחקר רב, הגעתי לנוסחה הבאה:

ּSELECT ARRAY(SELECT substring('ABCDEF' FROM 1 FOR i)
FROM generate_series(1, GREATEST(length('ABCDEF'))) g(i));

התוצאה היא פשוטה:

            array             
══════════════════════════════
 {A,AB,ABC,ABCD,ABCDE,ABCDEF}

מה זה הקסם הזה?
אתחיל לפתוח סוגריים מבפנים כלפי חוץ לשם ההסבר.
יש שימוש בפונקציה מובנית הקיימת ב PG בשם generate_series.
הפונקציה מאפשרת ליצור טווח (מספרי או תאריכי) מהתחלה מסוימת uעד יעד מסוים וצורת הקפיצה להשיג את היעד הסופי (למשל קפיצה של 25 ספרות).
כך שאם ארצה לקבל בין 0 ל100 את כל המספרים בקפיצה של 25, אכתוב זאת כך:

select generate_series(0, 100, 25);
 generate_series 
═════════════════
               0
              25
              50
              75
             100
(5 rows)

השלב הבא בפירוק המחרוזת הוא לקבל את הערכים לטבלה זמנית בשם "g" עם שדה בשם i.
עכשיו אפשר לחזור ל select הבוחר תתי מחרוזות ולהחזיר תת מחרוזת כאשר כל איטרציה מגדילה את כמות התווים.

אבל יש בעיה – אני מקבל מספר של רשומות (כל תת מחרוזת היא רשומה).
השלב הבא יהיה לכניס את המידע של כל הרשומות למערך:

select ARRAY(select generate_series(0, 100, 25));
      array       
══════════════════
 {0,25,50,75,100}
(1 row)

עכשיו אצור פונקציה בשם prefix על מנת שיהיה קל יותר להשתמש בתוצאה הסופית ולא אהיה צריך לחזור על עצמי כל כך הרבה פעמים:

CREATE OR REPLACE FUNCTION prefixes(varchar) 
   RETURNS varchar[]
   LANGUAGE sql IMMUTABLE
   AS $_$
SELECT ARRAY(SELECT substring($1 FROM 1 FOR i)
 FROM generate_series(1, GREATEST(length($1))) g(i))::varchar[];

את התוצאה השל הפונקציה ניתן להריץ על שאילתא המשתמשת באופרטור השוואה בשם ANY. ערך החזרה שלו הוא חיובי אם לפחות איבר אחד קיים ברשימה בתוך מערך השוואה.

select prefix, prefix=any(prefixes('0334567890'))
from prefix_providers;
  prefix │ ?column? 
════════╪══════════
 022    │ f
 032    │ f
 042    │ f
 082    │ f
 092    │ f
 0230   │ f
 0231   │ f
 0330   │ f
 0331   │ f
 0430   │ f
 0431   │ f
 0830   │ f
 0831   │ f
 0930   │ f
 0931   │ f
 025    │ f
 026    │ f
 027    │ f
 028    │ f
 029    │ f
 035    │ f
 036    │ f
 037    │ f
 038    │ f
 039    │ f
 0398   │ f
(26 rows)

כפי שניתן לראות הכל הוא False כי אמנם יש הרבה רשומות המתחילות ב03 עם עוד ספרה לאחריה, אבל אין קידומת של 03 עם הספרה 3 לאחר מכן (033). אם אוסיף תמיכה גם בקידומת הזו לפחות תשובה אחת תהיה חיובית:

insert into prefix_providers values ('033', 'Bezeq');

select prefix, prefix=any(prefixes('0334567890'))
from prefix_providers;
 prefix │ ?column? 
════════╪══════════
 022    │ f
 032    │ f
 042    │ f
 082    │ f
 092    │ f
 0230   │ f
 0231   │ f
 0330   │ f
 0331   │ f
 0430   │ f
 0431   │ f
 0830   │ f
 0831   │ f
 0930   │ f
 0931   │ f
 025    │ f
 026    │ f
 027    │ f
 028    │ f
 029    │ f
 035    │ f
 036    │ f
 037    │ f
 038    │ f
 039    │ f
 0398   │ f
 033    │ t
(27 rows)

כיצד להשתמש בזה בפועל?

select prefix, provider_name
from prefix_providers
where prefix=any(prefixes('03987654321'));
 prefix │ provider_name 
════════╪═══════════════
 039    │ Bezeq
(1 row)

אבל יש בעיה.
מה קורה כאשר יש לי גם קידומת 0398? התשובה היא שגם הרשומה הזו תחזור:

 prefix │ provider_name 
════════╪═══════════════
 039    │ Bezeq
 0398   │ me
(2 rows)

כאן נכסת תמיכה של פעולת SQL פשוטה שבה אני מחזיר את האיבר הגדול ביותר ורק אותו:

select max(prefix) prefix, provider_name
from prefix_providers
where prefix=any(prefixes('03987654321')) group by prefix
order by prefix desc
limit 1;
 prefix │ provider_name 
════════╪═══════════════
 0398   │ me
(1 row)

ועכשיו אני תמיד אקבל את ה prefix הארוך ביותר שמתאים למספר הטלפון שאני בודק.

09 January, 2022 03:26 PM

24 September, 2021

Lev Meirovitch

What is Ventoy, and why you should always have one!

TL;DR; Before I get to ranting, here is the quick answer: Ventoy is a Free Software multi-platform tool that lets you boot ISO files from a USB drive. Key features that make it different from other tools like Etcher or Unetbootin are: You don’t need to “flash” the ISO to the drive – just copy […]

24 September, 2021 11:20 AM

19 September, 2021

ik

מי הרג את התוכנה שלי?

מזה זמן רב היתה לי בעיה מאוד רצינית עם systemd. יש לי תוכנה שיצרתי אשר לפי ארגומנטים שונים מתנהגת לגמרי שונה בזמן עליה שלה.
למשל התמודדות עם docker, הרצת תהליך לפי כמות תורים (כל תור מקבל תהליך בפני עצמו) ועוד מספר התנהגויות.

כאשר אני רץ ב docker אין בעיה – דוקר מריץ אותי ישיר, אני משתמש במשתני סביבה של דוקר לקבל מידע שאני חייב, אך יש לי בעיה אחרת (שווה פוסט בפני עצמו) – הנחתת ביצועים ברמה מפחידה.

כאשר אני מריץ ידנית את התוכנה, הכל עובד ללא בעיות וההתנהגות היא כמצופה.
אבל כאשר אני מריץ אותה ב systemd, וההגדרות של המערכת היא יצירה של הרבה פרוססים, המערכת נתקעת או מתה מהר מאוד ללא שגיאה כלשהי (לרוב מתה מהר).

מחקר

לקח לי שבועות לבדוק את הקוד, לשנות גישה, לנסות להריץ את המערכת בגישות אחרות, ותמיד רק כאשר זה רק ב systemd התהליכים בעיקר מתים.

התחלתי לשחק קצת עם הגדרות systemd בכיוונים של type ב service שיצרתי, אבל זו לא היתה הבעיה.

התחלתי לחשוב כי אולי מדובר במשתני סביבה, או אפילו limits שונים, אבל הליכה ל pid תחת proc לא הראתה משהו ממש שונה שהרים לי נורה אדומה או שוני הנדרש ממני מעבר להגדרות הסביבה עצמה שהוגדרו.

כאשר הרצתי ידנית – הדבר העיקרי שהיה שונה היו משתני סביבה של חיבור ssh.
חשבתי כי אולי הבעיה היא stdout, אבל גם ככה אני תופס אותו וממיר אותו לקובץ, והוא אפילו כותב בזמן הריצה תחת systemd.

על מנת להבטיח כי זו אינה הבעיה, עשיתי הרצה עם detach ואז התנתקות מה ssh.
חזרתי לשרת אחרי עשר דקות בערך והמערכת עדיין רצה ללא בעיה, למרות שכבר לא היה לה טרמינל, הצלחתי לשלול את זה לגמרי (?).

בנקודה הזו אני כבר חודש (לא קלנדרי או רצוף) חוקר את הבעיה, ומתחיל לחפש באגים ידועים של systemd.
מסתבר אני לא היחיד שמתאר את התופעה, והיו תיקוני באגים שגרמו במקרים שונים להתרסקות של תוכנות, אבל אף אחת לא קשורה לשלי, והגרסה של systemd כבר מכילה את התיקונים לבאגים שמצאתי.

במקרה באחד הבאגים, היתה שאלה אשר ביקשה לקבל מידע על הגדרות בנושא של systemd.kill ושיש לבדוק אותו.

כאשר התחלתי לחפש על הנושא במנוע חיפוש, גיליתי כי מרבית השאילתות במנוע החיפוש היו איך "להרוג" את התוכנה עם systemd ואיך שולחים אותות (סיגנאלים) עם systemd, ופתאום האתר החביב על כולם stack-overflow גילה לי שיש אופציה ששוה לבדוק בשם KillMode (ואתם חשבתם כי דף 3-4 במנוע חיפוש זה מקום שפתרונות באים למות בהם).

חיפוש של systemd.kill עם KillMode הוביל אותי לתוצאות רלוונטיות יותר.

מציאת פיתרון

כאשר נכנסתי ל system.kill, יש הסבר שלדעתי לא מספיק טוב וממצא לאיך systemd מתמודד עם "הרג" של תהליכים בכל מצב.

ההגדרות עצמן יהיו תחת הגדרות ה service, אבל יש תיעוד מיוחד עבור נושאים שונים.
וכאמור, לפחות עבורי, תיעוד הנושא של KillMode אינו מספק על כלל האופציות שיש לו.

מסתבר כי ברירת המחדל היא להרוג "קבוצה" של תהליכים, כלומר התהליך שלי והבנים שלו, גם אם אני הרצתי עם exec ומנותק לגמרי מהבנים, עצם זה שהתהליך הריץ עוד דברים בזמן עליה, תגרום לכך שהיציאה של התהליך (במקרה הזה), תהרוג את הבנים (תודה stack overflow להסבר).

הפיתרון היה לשים

KillMode=process

לא ברור לי כל כך התפקיד של האופציה (מבחינת איך היא באמת עובדת), אבל היא אומרת שבמידה וה"אבא" שוחרר מהעולם, אין לשחרר את הבנים גם כן. וזו "אופציה לא מומלצת" (wwz).

כבר מספר שבועות שהמערכת נשארת באוויר ולא מתה בגלל systemd (אלא באגים שלי שאני מגלה ומתקן תוך כדי, אבל זה התפקיד שלי – ליצור באגים במקומות חדשים).

מבט לאחור

היו לי מספר דברים מאוד מביכים:

  1. לא שמתי לב כי בתחתית התיעוד של כל תיעוד בנושא יש הפניה לעוד נושאים עם קישור.
  2. החיפושים שלי היו שגויים ובדיעבד רק כאשר הבנתי שהמילים שלי היו לא נכונות התחלתי למצוא מידע רלוונטי.
  3. הגעתי למצב "שהסתובבתי סביב הזנב של עצמי" עם הבעיה במקום לשחרר אותה ולחזור בשלבים מאוחרים יותר.

כאשר הצלחתי להבין מה לחפש – המידע נהיה נגיש, אבל אוסף הדברים המביכים למעלה, גרם לכך שזה יקח זמן רב יותר, ולימוד אותי המון.

19 September, 2021 04:28 AM

20 July, 2021

Shlomi Noach

Reducing my OSS involvement, and how it affects orchestrator & gh-ost

I’m going to bring down my work volume around OSS to a minimum, specifically when it comes to orchestrator and gh-ost. This is to explain the whats and hows so that users are as informed as possible. TL;DR a period of time I will not respond to issues, will not review pull requests, will not produce releases, will not answer on mailing lists. That period of time is undefined. Could be as short as a few weeks, could be months, more, an unknown.

The “What”

Both orchestrator and gh-ost are popular tools in the MySQL ecosystem. They enjoy widespread adoption and are known to be used at prominent companies. Time and again I learn of more users of these projects. I used to keep a show-off list, I lost track since.

With wide adoption comes community engagement. This comes in the form of questions (“How do I…”, “Why does this not work…”, “Is it possible to…”), issues (crashing or data integrity bugs, locking issues, performance issues, etc.), suggestions (support this or that) and finally pull requests.

At this time, there’s multiple engagements per day. Between these two projects I estimate more than a full time job addressing those user interactions. That’s a full time job volume on top of an already existing full time job.

Much of this work went on employer’s time, but I have other responsibilities at work, too, and there is no room for a full-time-plus work on these projects. Responding to all community requests is unsustainable and futile. Some issues are left unanswered. Some pull requests are left open.

Even more demanding than time is context. To address a user’s bug report I’d need to re-familiarize myself with 5-year old code. That takes the toll of time but also memory and context switch. As community interaction goes, a simple discussion on an Issue can span multiple days. During those days I’d jump in and out of context. With multiple daily engagements this would mean re-familiarizing myself with different areas of the code, being able to justify a certain behavior; or have good arguments to why we should or should not change it; being able to simulate a scenario in my brain (I don’t have access to users’ environments); comprehend potential scenarios and understand what could break as result of what change — I don’t have and can’t practically have the tests to cover the myriad of scenarios, deployments, software, network and overall infrastructure in all users environments.

Even if I set designated time for community work, this still takes a toll on my daily tasks. The need to have a mental projection in your brain for all that’s open and all that’s to come makes it harder to free my mind and work on a new problem, to really immerse myself in thought, to create something new.

When? For how long?

Effective immediately. I made some promises, and there’s a bunch of open issues and pull requests I intend to pursue, but going forward I’m going to disengage from further questions/requests/suggestions. I’m gonna turn off repo notifications and not get anything in my mailbox.

My intention is to step back, truly disengage, and see what happens. There’s a good chance (this happened before) that after some time I feel the itch to come back to working on these projects. Absolutely no commitments made here.

What does this mean for orchestrator?

After 7 years of maintaining this project, first at Outbrain, then Booking.com, then GitHub and now at PlanetScale, I’m gonna step back and refrain from new developments, from responding to issues, from answering questions, from reviewing pull requests.

I should mention that in the past year or so, I’ve merged more community contributions than my own. That’s staggering! There are very capable contributors to this project.

In essence, the core of orchestrator hasn’t changed in a while. The main logic remains the same. I suspect orchestratorwill remain effective for time to come. I am sure some users will be alarmed at this post, and wonder whether they should keep using orchestrator or search for other solutions. I am in no position to make a suggestion. Users should carefully evaluate what’s in their best interests, what they deem to be stable and reliable software, what they deem to be supported or repairable, etc.

What does this mean for gh-ost?

I co-designed and co-authored gh-ost at GitHub (announcement) as part of the database infrastructure team. We wrote gh-ost to solve a pressing issue of schema changes at GitHub, and were happy to open source it. This led to, frankly, an overwhelming response from the community, with very fast adoption. Within the first few months we received invaluable feedback, bug reports, suggestions, all of which had direct and positive impact to gh-ost.

I’m not working at GitHub anymore, and I’m not an official maintainer of the upstream repo anymore. I do not have the authority to merge PRs or close issues. It is as it should be, the project is owned by GitHub.

I use gh-ost as part of my current job at PlanetScale working on OSS Vitess. Vitess utilizes gh-ost for online DDL. I therefore am an interested party in gh-ost, most specifically to ensure it is correct and sound. For this reason, I selectively engage with users on GitHub’s repo, especially when it comes to issues I consider important for Vitess.

I do maintain a fork, where I either interact with users, or push my own changes. I collaborate with the GitHub team, contribute upstream changes I make on my fork, and pull changes downstream. The GitHub team is kind enough to accept my contributions and invest time in testing and evaluating what might be risky changes. The upstream and downstream code is mostly in sync.

Going forward I will continue to work on things critical to my current job, but otherwise I’ll be stepping away and reduce interactions. This means I will not accept pull requests or answer questions. The upstream gh-ost repo remains under GitHub’s ownership and maintained by GitHub’s engineers. It is not in my authority to say how the upstream project will engage with the community and I do not presume to make suggestions.

On community interaction

I must say that I’m thoroughly humbled and grateful for the interactions on these projects. I hear of other OSS projects suffering abuse, but my work has seen respectful, thoughtful, empowering and inspiring user interactions. The majority of users invest time and thought in articulating an issue, or engage in respectful discussion while suggesting changes. I’ve actually “met” people through these interactions. I can only hope I payed back in same coin.

On community assistance

Community also provides assistance in several forms. The simplest and truly most helpful is by answering questions. Some community members will respond on issues, or on mailing lists, in chat rooms. Some users will identify similar issues to their own, opened by other users, will discuss and help each other, and share information.

Some companies and users are consistent contributors, working on issues that are both specific to their particular needs, as well as ultimately useful for the greater community.

At a previous time where I was overwhelmed with OSS/community work, two prominent companies, let’s call them S and P, stepped forward to offer actual development time; assign their own engineers part-time for a limited period to help pushing forward. I’m forever grateful for their kindness! I didn’t take those offers back then, because I didn’t have a good plan (I still don’t) for coordinating that kind of work; it felt like it would take even more efforts to set it up.

Can we jump in as contributors?

I don’t have a good plan for making this work, or for ensuring that this works well. I prefer that users fork orchestrator, and to not bring in contributors to this repo. If a contributor does have a solid plan, you probably know where to find me.

20 July, 2021 12:14 PM

19 July, 2021

Guy Sheffer

BackupFriend – Self-hosted backup to your RaspberryPi with a history and UI!

BackupFriend logo
Atribution: Icon by: Freepik

Hey all,
I am releasing today something I’ve been working on the past year. It stared with a friend that had a requirement to do off-site backups of his work for his insurance, but BackupFriend has became a full blown backup solution.
The idea is you get a RaspberryPi and plug a harddrive to it, put it at your friends, family or just in your house and backup up to it using a desktop client that should have the feel like Dropbox/Google Drive/etc. You also get history! The RaspberryPi can also be changed to a remote server (instructions here). This guide focuses on self-hosted instructions, because I think its strange all backup solutions out there require you to pay rent for your own data.
Using a 4TB drive for under $100 and a Pi, you can get much more storage which is not ephemeral.
The desktop client has been tested on both Linux, MacOS and Windows.

Also, many thanks to Pull Request Community that featured BackupFriend as a project to work on, that helped get a few PRs on-board.

What you will need

  1. A Raspberry Pi, preferably 4B because of the USB3
  2. A home network with a computer running Linux, MacOS or Windows, which you will be backing up from
  3. An external hard drive that can connect to the Pi (I use a 4TB WD My Passport drive, you can also just use a thumb drive for testing).

How to install on a Pi

  1. Download and the BackupFriend image (source code so you can see what’s under the hood)
  2. Unzip the image and install it to an SD card like any other Raspberry Pi image
  3. Configure your WiFi by editing backupfriendpi-wpa-supplicant.txt at the root of the flashed card when using it like a flash drive (You can also just plug the device to an Ethernet port on your router).
  4. Attach the external drive and power up.
  5. Hostname is backupfriend (not raspberrypi as usual), username: pi and inital password is: raspberry
  6. After a few minutes you should be able to access http://backupfriend/ or http://backupfriend.local.
  7. Default password for the Web UI is admin password admin123.

You should see a login screen like this:

At this point you have the backup server running. Excellent!

The backup server is now sitting on your local network. If you want to have it backing up on a remote location, you will need to open the router port to it, and set the domain name on the nginx-proxy container there. More info on that here.

How to set up the Desktop Client

Now that we have a server on the Pi, let’s backup to it form the local host.

Linux

sudo python3 -m pip install backupfriend

Windows

  1. Download .zip for windows run the executable backupfriend-client.exe.
  2. If you want to make it start on boot follow this guide.

Mac

  1. Download the .zip for mac and open it to extract the .app
  2. Copy it to our applications folder.
  3. If you want to make it start on boot follow this guide (guide would not work if the .app is not in the applications folder).

First Time Run

On the first run you will be asked to follow a wizard and create your connection keys. Those let you backup sequentially to the server. Just follow the guide and copy the public key:

First time run
The SSH public key you need to copy and place in the server

Server setup

Now that we have a key, let’missing apostrophes place it in the server.
Log in to your backup server using the default

user: admin
password: admin123

You should get this view as shown below

Go to admin on the top right and select “Profile”

We need to set up the sync folder and SSH key.

Web interface first login

In the SSH key page press “add new SSH key” and paste the public SSH key you got from the BackupFriend Client:

Adding an SSH key to the webserver

Now there is one more step to do before we can start backing up – setting the root folder for the user.
Click on “Admin area” and then on the “Users: 1” button as shown below:

The admin area page

Select the only admin user in the list and click on the “edit” button. You should see the following edit page.

Here you need to add the “Root directory” to be “/backup”. This means that anything in the “/backup” folder on the Pi would be visible in the web interface.

Edit admin user

Once the changes are saved you will see the amount of free space on the main window:

Main page with free storage shown

Now we can finally sync. The first install comes with an example sync. It just syncs your temp folder. Click the “edit” and then you can confirm that it all works using the “test” button. You should get “connection succeeded”.
Note: Sometimes you might see first “warning: server added to authorized servers”. Just press “Test” again, its the SSH system setting that server as an authorized one.

When the job is running it will turn blue, when it’s finished it will turn green:

Example job running

Once it’s done, or in the middle, you can access the backup on the web interface.

To do so you might need on the first time to refresh the repositories to it will be shown. To do that go to the “profile” and press “refresh repositories”:

Profile page scrolled to the bottom to show “refresh repositories”

Finally, you can see now the repositories and the files with their versions:

Example repository stored

That’s it, you should have now a backup server on a Pi that you can also move elsewhere.

Development – Source Code Repos

There are quite a few parts for the project, here are the repos for them:

This is just version 0.1.0 and there is a lot to improve. Since I am only one person I would greatly appreciate PRs and help getting this to be a full blown solution.

Full text

19 July, 2021 03:02 PM

23 April, 2021

Ilan Shavit

רכישת מחשב חדש, כל מה שצריך לדעת: לוח אם (חלק 4)

מה תפקידו של לוח האם?
לוח האם מחבר בין כל חלקי המחשב, אליו מתחברים הרכיבים ודרכו הם "מדברים".
באיור 1 פירטתי את המחברים השונים שקיימים בלוח אם טיפוסי: ניתן לראות את שקע המעבד, את שקעי הזיכרון (RAM), שקע לכרטיס מסך, שקעי SATA (אליהם מחברים דיסק הקשיח / צורב).
אם אמשיל את המחשב למכונית אז לוח האם מהווה את השלדה של הרכב. כשם שלשלדת רכב מחברים את כל רכיבי המכונית כך ללוח האם מחברים את כל רכיבי המחשב. כשם שבמכונית ספורט עם מנוע פרארי לא תשימו שילדה של פיאט 850 כך גם בלוח האם: אם השקעתם במעבד יקר מן הסתם שתשקיעו גם בלוח אם איכותי (למרות שניתן להרכיב גם לוח אם פשוט).

בוחרים לוח אם מיד לאחר שקונים מעבד. אם קניתם מעבד של Intel תצטרכו לבחור בלוח אם שתומך במעבדי Intel (מהדגם הספציפי שקניתם), כנ"ל אם תקנו מעבד AMD.
אם ברשותכם מעבד ישן רוב הסיכויים שתתקשו למצוא לו לוח אם מתאים (כך שאם ברשותכם לוח מקולקל תתקשו למצוא לו תחליף: תוכלו לרכוש באתרים כגון Ebay, עם כל הסיכון הכרוך בכך, פחות בחנויות מחשבים רגילות)
בלוח האם מיושמת אלקטרוניקה "כבדה" שמאפשרת את עבודת המחשב. האלקטרוניקה הזאת מיושמת באמצעות ערכות שבבים הנקראים Chipset. יש Chipset זולים, שמתאימים למחשבים פשוטים, ויש יקרים יותר.
כל המעבדים החדשים של אינטל (דורות 8 ו- 9) מחייבים שימוש בציפסט מסדרה 300. ניתן לדרג את איכות הציפסט כך:
H310 < B360, B365 < H370 < Z370 < Z390
למה אני מייחס איכות?
  • מספר חריצי הרחבת זכרון (2 או 4)
  • יכולות המהרה
  • איכות כרטיס הקול
  • כמות יציאות USB
  • אפשרות לחבר SSD מסוג M2 ישירות ללוח האם
  • איכות הרכיבים (קבלים בעיקר) ואיכות הבניה כללית
כללי האצבע לבחירת לוח אם:
  • לוח מבוסס ציפסט H310 הוא הלוח הפשוט והזול ביותר. תבחר בו אם בחרת במעבד Intel Pentium
  • תבחר בלוח מבוסס ציפסט B360 או B365 אם בחרת במעבד Intel Core i3
  • תבחר בלוח מבוסס ציפסט H370 אם בחרת במעבד Intel Core i5
  • תבחר בלוח מבוסס ציפסט Z370 אם בחרת במעבד Intel Core i7
  • תבחר בלוח מבוסס ציפסט Z390 אם בחרת במעבד Intel Core i9
    ההיגיון בבחירה הוא זה: אם שילמת 1500 ש"ח על מעבד אז בבקשה אל תקנה לוח אם שעולה 200 ש"ח… זה יעבוד, אבל כדאי מאוד להשקיע יותר ולהתאים את איכות הלוח לאיכות המעבד…
ל- AMD יש כמובן סדרות אחרות של ציפסטים אבל הרעיון דומה…

23 April, 2021 05:43 PM

רכישת מחשב חדש, כל מה שצריך לדעת: זכרון (חלק 3)

אז אחרי שבחרנו מעבד אתמקד הפעם ברכישת זכרון RAM
בטח תשאלו: למה מחשב צריך בכלל זכרון? למה הוא משמש?
הזיכרון הוא אזור העבודה של המעבד. כשאתם טוענים תוכנה (אופיס, מחשבון או כל תוכנה אחרת) התוכנה נטענת מהדיסק הקשיח לתוך אזור מסוים בזיכרון ושם היא רצה. מאחר שהזיכרון מאוד מהיר אז מעבר מתוכנה לתוכנה מתבצע כהרף עין (המעבד רק מדלג בין אזורים שונים בזיכרון). כשאתם מדליקים את המחשב גם מערכת ההפעלה עצמה נטענת לזיכרון ורצה ממנו.

כפי שניתן להבין, לזיכרון תפקיד קריטי בעבודת המחשב. תקלה ברכיב לא תאפשר עבודה שוטפת במחשב (הוא יקרוס, תראו מסכים כחולים והדבר היחידי שניתן יהיה לעשות זה לכבות אותו בכוח)
דרישת המינימום של חלונות 10 היא 2 גיגה בייט (2GB) זכרון.
מה זה גיגה בייט? גיגה זה מיליארד. אז 2 גיגה בייט זה 2 מיליארד תאי זכרון. בדרך כלל רוכשים 4 גיגה בייט זכרון (כשיש מגבלה תקציבית מאוד גדולה), 8, 16 או 32 גיגה בייט (למשתמשים הכבדים ביותר).
באיור 1 ניתן לראות כיצד נראה התקן זכרון של מחשב נייד. זכרון של מחשב נייח נראה דומה (רק הוא קצת יותר ארוך – איור 2).
קניית זכרון הוא תהליך פשוט יחסית. תפעלו לפי הכללים הבא:
1. "כמה שיותר הרי זה משובח…"
2. “קנו תמיד את הדגם האחרון"
היסטוריה: פעם השתמשו בהתקן זכרון שנקרא SDRAM. עם הזמן הוא שודרג ונקרא DDR. השנים חלפו, המהירויות גדלו וככה נוספו ספרות שונות לרכיב: DDR3, DDR2 ועכשיו מוכרים DDR4. אם תקראו את המאמר בעוד מספר שנים בטח יהיה DDR5 או DDR6. אתם תקנו תמיד את הדגם האחרון (DDR4 בזמן כתיבת המאמר).
בסעיף קודם כתבתי לקנות כמה שיותר זכרון אבל בכל זאת לא צריך להשתגע… מס' כללי אצבע לרכישת זכרון:
  • נפח 4GB: כשהתקציב מאוד לוחץ. מתאים לאדם שכל רצונו לגלוש מעת לעת במחשב (בלי הרבה לשוניות פתוחות), לערוך מסמכים ולשחק במשחקים פשוטים
  • נפח 8GB: נפח שמתאים לרוב האוכלוסיה ולרוב השימושים
  • נפח 16GB: מתאים לגיימרים, עורכי וידאו ופוטושופ
  • נפח 32GB: מתאים לגיימרים כבדים ועורכי וידאו מיקצועיים.
הערה:
הזיכרון עליו כתבתי הוא זכרון נדיף. זה אומר שהמידע שעליו נמחק ברגע שאתחלתם או כיביתם את המחשב (מידע קבוע נשמר רק בדיסק הקשיח)

23 April, 2021 05:43 PM

07 March, 2021

Lev Meirovitch

How “undefined” is undefined behavior?

I was browsing StackOverflow yesterday, and encountered an interesting question.Unfortunately, that question was closed almost immediately, with comments stating: “this is undefined behavior” as if there was no explanation to what was happening. But here is the twist: the author of the question knew already it was “undefined behavior”, but he was getting consistent results, […]

07 March, 2021 12:45 AM

20 February, 2021

Amir Aharoni

Amir Aharoni’s Quasi-Pro Tips for Translating the Software That Powers Wikipedia, 2020 Edition

This is a new version of a post that was originally published in 2015. Much of it is the same, but there are several updates that justified publishing a new version.

Introduction

As you probably already know, Wikipedia is a website. A website has two components: the content and the user interface. The content of Wikipedia is the articles, as well as various discussion and help pages. The user interface is the menus around the articles and the various screens that let editors edit the articles and communicate to each other.

Another thing that you probably already know is that Wikipedia is massively multilingual, so both the content and the user interface must be translated.

Translation of articles is a topic for another post. This post is about getting all the user interface translated to your language, and doing it as quickly, easily, and efficiently as possible.

The most important piece of software that powers Wikipedia and its sister projects is called MediaWiki. As of today, there are more than 3,800 messages to translate in MediaWiki, and the number grows frequently. “Messages” in the MediaWiki jargon are strings that are shown in the user interface. Every message can and should be translated.

In addition to core MediaWiki, Wikipedia also uses many MediaWiki extensions. Some of them are very important because they are frequently seen by a lot of readers and editors. For example, these are extensions for displaying citations and mathematical formulas, uploading files, receiving notifications, mobile browsing, different editing environments, etc. There are more than 5,000 messages to translate in the main extensions, and over 18,000 messages to translate if you want to have all the extensions translated, including the most technical ones. There are also the Wikipedia mobile apps and additional tools for making automated edits (bots) and monitoring vandalism, with several hundreds of messages each.

Translating all of it probably sounds like an impossibly enormous job. It indeed takes time and effort, but the good news are that there are languages into which all of this was translated completely, and it can also be completely translated into yours. You can do it. In this post I’ll show you how.

A personal story

In early 2011 I completed the translation of all the messages that are needed for Wikipedia and projects related to it into Hebrew. All. The total, complete, no-excuses, premium Wikipedia experience, in Hebrew. Every single part of the MediaWiki software, extensions and additional tools was translated to Hebrew. Since then, if you can read Hebrew, you don’t need to know a single English word to use it.

I didn’t do it alone, of course. There were plenty of other people who did this before I joined the effort, and plenty of others who helped along the way: Rotem Dan, Ofra Hod, Yaron Shahrabani, Rotem Liss, Or Shapiro, Shani Evenshtein, Dagesh Hazak, Guycn2 and Inkbug (I don’t know the real names of the last three), and many others. But back then in 2011 it was I who made a conscious effort to get to 100%. It took me quite a few weeks, but I made it.

However, the software that powers Wikipedia changes every single day. So the day after the translations statistics got to 100%, they went down to 99%, because new messages to translate were added. But there were just a few of them, and it took me only a few minutes to translate them and get back to 100%.

I’ve been doing this almost every day since then, keeping Hebrew at 100%. Sometimes it slips because I am traveling or because I am ill. It slipped for quite a few months in 2014 because my first child was born and a lot of new messages happened to be added at about the same time, but Hebrew got back to 100%. It happened again in 2018 for the same happy reason, and went back to 100% after a few months. And I keep doing this.

With the sincere hope that this will be useful for helping you translate the software that powers Wikipedia completely to your language, let me tell you how.

Preparation

First, let’s do some work to set you up.

If you haven’t already, create a translatewiki.net account at the translatewiki.net main page. First, select the languages you know by clicking the “Choose another language” button (if the language into which you want to translate doesn’t appear in the list, choose some other language you know, or contact me). After selecting your language, enter your account details. This account is separate from your Wikipedia account, so if you already have a Wikipedia account, you need to create a new one. It may be a good idea to give it the same username.

After creating the account you have to make several test translations to get full translator permissions. This may take a few hours. Everybody except vandals and spammers gets full translator permissions, so if for some reason you aren’t getting them or if it appears to take too much time, please contact me.

Make sure you know your ISO 639 language code. You can easily find it on Wikipedia.

Go to your preferences, to the Editing tab, and add languages that you know to Assistant languages. For example, if you speak one of the native languages of South America like Aymara (ay) or Quechua (qu), then you probably also know Spanish (es) or Portuguese (pt), and if you speak one of the languages of Indonesia like Javanese (jv) or Balinese (ban), then you probably also know Indonesian (id). When available, translations to these languages will be shown in addition to English.

Familiarize yourself with the Support page and with the general localization guidelines for MediaWiki.

Add yourself to the portal for your language. The page name is Portal:Xyz, where Xyz is your language code.

Priorities, part 1

The translatewiki.net website hosts many projects to translate beyond stuff related to Wikipedia. It hosts such respectable Free Software projects as OpenStreetMap, Etherpad, MathJax, Blockly, and others. Also, not all the MediaWiki extensions are used on Wikimedia projects. There are plenty of extensions, with thousands of translatable messages, that are not used by Wikimedia, but only on other sites, but they use translatewiki.net as the platform for translation of their user interface.

It would be nice to translate all of it, but because I don’t have time for that, I have to prioritize.

On my translatewiki.net user page I have a list of direct links to the translation interface of the projects that are the most important:

I usually don’t work on translating other projects unless all the above projects are 100% translated to Hebrew. I occasionally make an exception for OpenStreetMap or Etherpad, but only if there’s little to translate there and the untranslated MediaWiki-related projects are not very important.

Priorities, part 2

So how can you know what is important among more than 18,000 messages from the Wikimedia universe?

Start from MediaWiki most important messages. If your language is not at 100% in this list, it absolutely must be. This list is automatically created periodically by counting which 600 or so messages are actually shown most frequently to Wikipedia users. This list includes messages from MediaWiki core and a bunch of extensions, so when you’re done with it, you’ll see that the statistics for several groups improved by themselves.

Now, if the translation of MediaWiki core to your language is not yet at 18%, get it there. Why 18%? Because that’s the threshold for exporting your language to the source code. This is essential for making it possible to use your language in your Wikipedia (or Incubator). It will be quite easy to find short and simple messages to translate (of course, you still have to do it carefully and correctly).

Some technical notes

Have you read the general localization guide for Mediawiki? Read it again, and make sure you understand it. If you don’t, ask for help! The most important section, especially for new translators, is “Translation notes”.

A super-brief list of things that you should know:

Learn to use the project selector at the top of the translation interface. Projects are also known as “Message groups”. For example, each extension is a message group, and some larger extension, such as Visual Editor, are further divided into several smaller message groups. Using the selector is very simple: Just click “All” next to “Message group”, and use the search box to find the component that you want to translate, such as “Visual Editor” or “Wikibase”. Clicking on a message group will load the untranslated messages for that group.

The “Extensions used by Wikimedia” group is divided into several more subgroups. The important one is “Extensions used by Wikimedia – Main”, which includes the most commonly used extensions. Other subgroups are:

There is also a group called “EXIF Tags”. It’s an advanced part of core MediaWiki. It mostly includes advanced photography terminology, and it shows information about photographs on Wikimedia Commons. If you are not sure how to translate these messages, ask a professional photographer. In any case, it’s OK to do it later, after you completed more important components.

Getting things done, one by one

Once you have the most important MediaWiki messages 100% and at least 18% of MediaWiki core is translated to your language, where do you go next?

I have surprising advice.

You need to get everything to 100% eventually. There are several ways to get there. Your mileage may vary, but I’m going to suggest the way that worked for me: Complete the easiest piece that will get your language closer to 100%! For me this is an easy way to remove an item off my list and feel that I accomplished something.

But still, there are so many items at which you could start looking! So here’s my selection of components that are more user-visible and less technical. The list is ordered not by importance, but by the number of messages to translate (as of October 2020):

I put MediaWiki core last intentionally. It’s a very large message group, with over 3000 messages. It’s hard to get it completed quickly, and actually, some of its features are not seen very frequently by users who aren’t site administrators or very advanced editors. By all means, do complete it, try to do it as early as possible, and get your friends to help you, but it’s also OK if it takes some time.

Getting all the things done

OK, so if you translate all the items above, you’ll make Wikipedia in your language mostly usable for most readers and editors. But let’s go further.

Let’s go further not just for the sake of seeing pure 100% in the statistics everywhere. There’s more.

As I wrote above, the software changes every single day. So do the translatable messages. You need to get your language to 100% not just once; you need to keep doing it continuously.

Once you make the effort of getting to 100%, it will be much easier to keep it there. This means translating some things that are used rarely (but used nevertheless; otherwise they’d be removed). This means investing a few more days or weeks into translating-translating-translating.

You’ll be able to congratulate yourself not only upon the big accomplishment of getting everything to 100%, but also upon the accomplishments along the way.

One strategy to accomplish this is translating extension by extension. This means, going to your translatewiki.net language statistics: here’s an example with Albanian, but choose your own language. Click “expand” on MediaWiki, then again “expand” on “MediaWiki Extensions” (this may take a few seconds—there are lots of them!), then on “Extensions used by Wikimedia” and finally, on “Extensions used by Wikimedia – Main”. Similarly to what I described above, find the smaller extensions first and translate them. Once you’re done with all the Main extensions, do all the extensions used by Wikimedia. This strategy can work well if you have several people translating to your language, because it’s easy to divide work by topic. (Going to all extensions, beyond Extensions used by Wikimedia, helps users of these extensions, but doesn’t help Wikipedia very much.)

Another fun strategy is quiet and friendly competition with other languages. Open the statistics for Extensions Used by Wikimedia – Main and sort the table by the “Completion” column. Find your language. Now translate as many messages as needed to pass the language above you in the list. Then translate as many messages as needed to pass the next language above you in the list. Repeat until you get to 100%.

For example, here’s an excerpt from the statistics for today:

Let’s say that you are translating to Georgian. You only need to translate 37 messages to pass Marathi and go up a notch (2555 – 2519 + 1 = 37). Then 56 messages more to pass Hindi and go up one more notch (2518 – 2463 + 1 = 56). And so on.

Once you’re done, you will have translated over 5600 messages, but it’s much easier to do it in small steps.

Once you get to 100% in the main extensions, do the same with all the Extensions Used by Wikimedia. It’s way over 10,000 messages, but the same strategies work.

Good stuff to do along the way

Invite your friends! You don’t have to do it alone. Friends will help you work more quickly and find translations to difficult words.

Never assume that the English message is perfect. Never. Do what you can to improve the English messages. Developers are people just like you are. There are developers who know their code very well, but who are not the best writers. And though some messages are written by professional user experience designers, many are written by the developers themselves. Developers are developers; they are not necessarily very good writers or designers, and the messages that they write in English may not be perfect. Also, keep in mind that many, many MediaWiki developers are not native English speakers; a lot of them are from Russia, Netherlands, India, Spain, Germany, Norway, China, France and many other countries. English is foreign to them, and they may make mistakes.

So if anything is hard to translate, of if there are any other problems with the English messages to the translatewiki Support page. While you are there, use the opportunity to help other translators who are asking questions there, if you can.

Another good thing is to do your best to try using the software that you are translating. If there are thousands of messages that are not translated to your language, then chances are that it’s already deployed in Wikipedia and you can try it. Actually trying to use it will help you translate it better.

Whenever relevant, fix the documentation displayed near the translation area. Strange as it may sound, it is possible that you understand the message better than the developer who wrote it!

Before translating a component, review the messages that were already translated. To do this, click the “All” tab at the top of the translation area. It’s useful for learning the current terminology, and you can also improve them and make them more consistent.

After you gain some experience, create or improve a localization guide in your language. There are very few of them at the moment, and there should be more. Here’s the localization guide for French, for example. Create your own with the title “Localisation guidelines/xyz” where “xyz” is your language code.

As in Wikipedia itself, Be Bold.

OK, so I got to 100%, what now?

Well done and congratulations.

Now check the statistics for your language every day. I can’t emphasize enough how important it is to do this every day. If not every day, then as frequently as you can.

The way I do this is having a list of links on my translatewiki.net user page. I click them every day, and if there’s anything new to translate, I immediately translate it. Usually there are just a few new messages to translate; I didn’t measure precisely, but usually it’s fewer than 20. Quite often you won’t have to translate from scratch, but to update the translation of a message that changed in English, which is usually even faster.

But what if you suddenly see 200 new messages to translate or more? It happens occasionally. Maybe several times a year, when a major new feature is added or an existing feature is changed. Basically, handle it the same way you got to 100% before: step by step, part by part, day by day, week by week, notch by notch, and get back to 100%.

But you can also try to anticipate it. Follow the discussions about new features, check out new extensions that appear before they are added to the Extensions Used by Wikimedia group, consider translating them when you have a few spare minutes. At the worst case, they will never be used by Wikimedia, but they may be used by somebody else who speaks your language, and your translations will definitely feed the translation memory database that helps you and other people translate more efficiently and easily.

Consider also translating other useful projects: OpenStreetMap, Etherpad, Blockly, Encyclopedia of Life, etc. Up to you. The same techniques apply everywhere.

What do I get for doing all this work?

The knowledge that thanks to you, people who read in your language can use Wikipedia without having to learn English. Awesome, isn’t it? Some people call it “Good karma”. Also, the knowledge that you are responsible for creating and spreading the terminology in your language for one of the most important and popular websites in the world.

Oh, and you also get enormous experience with software localization, which is a rather useful and demanded job skill these days.

Is there any other way in which I can help?

Yes!

If you find this post useful, please translate it to other languages and publish it in your blog. No copyright restrictions, public domain (but it would be nice if you credit me and send me a link to your translation). Make any adaptations you need for your language. It took me years of experience to learn all of this, and it took me about four hours to write it. Translating it will take you much less than four hours, and it will help people be more efficient translators.

Thanks!

20 February, 2021 05:19 PM

23 October, 2020

Amir Aharoni

Amir Aharoni’s Quasi-Pro Tips for Translating the Software That Powers Wikipedia

This post is outdated. For a newer version see Amir Aharoni’s Quasi-Pro Tips for Translating the Software That Powers Wikipedia, 2020 Edition


As you probably already know, Wikipedia is a website. A website has content—the articles; and it has user interface—the menus around the articles and the various screens that let editors edit the articles and communicate to each other.

Another thing that you probably already know is that Wikipedia is massively multilingual, so both the content and the user interface must be translated.

Translation of articles is a topic for another post. This post is about getting all of the user interface translated to your language, as quickly and efficiently as possible.

The most important piece of software that powers Wikipedia and its sister projects is called MediaWiki. As of today, there are 3,335 messages to translate in MediaWiki, and the number grows frequently. “Messages” in the MediaWiki jargon are strings that are shown in the user interface, and that can be translated. In addition to core MediaWiki, Wikipedia also has dozens of MediaWiki extensions installed, some of them very important—extensions for displaying citations and mathematical formulas, uploading files, receiving notifications, mobile browsing, different editing environments, etc. There are around 3,500 messages to translate in the main extensions, and over 10,000 messages to translate if you want to have all the extensions translated. There are also the Wikipedia mobile apps and additional tools for making automated edits (bots) and monitoring vandalism, with several hundreds of messages each.

Translating all of it probably sounds like an enormous job, and yes, it takes time, but it’s doable.

In February 2011 or so—sorry, I don’t remember the exact date—I completed the translation into Hebrew of all of the messages that are needed for Wikipedia and projects related to it. All. The total, complete, no-excuses, premium Wikipedia experience, in Hebrew. Every single part of the MediaWiki software, extensions and additional tools was translated to Hebrew, and if you were a Hebrew speaker, you didn’t need to know a single English word to use it.

I wasn’t the only one who did this of course. There were plenty of other people who did this before I joined the effort, and plenty of others who helped along the way: Rotem Dan, Ofra Hod, Yaron Shahrabani, Rotem Liss, Or Shapiro, Shani Evenshtein, Inkbug (whose real name I don’t know), and many others. But back then in 2011 it was I who made a conscious effort to get to 100%. It took me quite a few weeks, but I made it.

Of course, the software that powers Wikipedia changes every single day. So the day after the translations statistics got to 100%, they went down to 99%, because new messages to translate were added. But there were just a few of them, and it took me a few minutes to translate them and get back to 100%.

I’ve been doing this almost every day since then, keeping Hebrew at 100%. Sometimes it slips because I am traveling or I am ill. It slipped for quite a few months because in late 2014 I became a father, and a lot of new messages happened to be added at the same time, but Hebrew is back at 100% now. And I keep doing this.

With the sincere hope that this will be useful for translating the software behind Wikipedia to your language, let me tell you how.

Preparation

First, let’s do some work to set you up.

Priorities, part 1

The translatewiki.net website hosts many projects to translate beyond stuff related to Wikipedia. It hosts such respectable Free Software projects as OpenStreetMap, Etherpad, MathJax, Blockly, and others. Also, not all the MediaWiki extensions are used on Wikimedia projects; there are plenty of extensions, with thousands of translatable messages, that are not used by Wikimedia, but only on other sites, but they use translatewiki.net as the platform for translation of their user interface.

It would be nice to translate all of it, but because I don’t have time for that, I have to prioritize.

On my translatewiki.net user page I have a list of direct links to the translation interface of the projects that are the most important:

I usually don’t work on translating other projects unless all of the above projects are 100% translated to Hebrew. I occasionally make an exception for OpenStreetMap or Etherpad, but only if there’s little to translate there and the untranslated MediaWiki-related projects are not very important.

Priorities, part 2

So how can you know what is important among more than 15,000 messages from the Wikimedia universe?

Start from MediaWiki most important messages. If your language is not at 100% in this list, it absolutely must be. This list is automatically created periodically by counting which 600 or so messages are actually shown most frequently to Wikipedia users. This list includes messages from MediaWiki core and a bunch of extensions, so when you’re done with it, you’ll see that the statistics for several groups improved by themselves.

Now, if the translation of MediaWiki core to your language is not yet at 18%, get it there. Why 18%? Because that’s the threshold for exporting your language to the source code. This is essential for making it possible to use your language in your Wikipedia (or Incubator). It will be quite easy to find short and simple messages to translate (of course, you still have to do it carefully and correctly).

Getting Things Done, One by One

Once you have the most important MediaWiki messages 100% and at least 18% of MediaWiki core is translated to your language, where do you go next?

I have surprising advice.

You need to get everything to 100% eventually. There are several ways to get there. Your mileage may vary, but I’m going to suggest the way that worked for me: Complete the easiest piece that will get your language closer to 100%! For me this is an easy way to strike an item off my list and feel that I accomplished something.

But still, there are so many items at which you could start looking! So here’s my selection of components that are more user-visible and less technical, sorted not by importance, but by the number of messages to translate:

I put MediaWiki core last intentionally. It’s a very large message group, with over 3000 messages. It’s hard to get it completed quickly, and to be honest, some of its features are not seen very frequently by users who aren’t site administrators or very advanced editors. By all means, do complete it, try to do it as early as possible, and get your friends to help you, but it’s also OK if it takes some time.

Getting All Things Done

OK, so if you translate all the items above, you’ll make Wikipedia in your language mostly usable for most readers and editors.

But let’s go further.

Let’s go further not just for the sake of seeing pure 100% in the statistics everywhere. There’s more.

As I wrote above, the software changes every single day. So do the translatable messages. You need to get your language to 100% not just once; you need to keep doing it continuously.

Once you make the effort of getting to 100%, it will be much easier to keep it there. This means translating some things that are used rarely (but used nevertheless; otherwise they’d be removed). This means investing a few more days or weeks into translating-translating-translating.

You’ll be able to congratulate yourself not only upon the big accomplishment of getting everything to 100%, but also upon the accomplishments along the way.

One strategy to accomplish this is translating extension by extension. This means, going to your translatewiki.net language statistics: here’s an example with Albanian, but choose your own language. Click “expand” on MediaWiki, then again “expand” on “MediaWiki Extensions”, then on “Extensions used by Wikimedia” and finally, on “Extensions used by Wikimedia – Main”. Similarly to what I described above, find the smaller extensions first and translate them. Once you’re done with all the Main extensions, do all the extensions used by Wikimedia. (Going to all extensions, beyond Extensions used by Wikimedia, helps users of these extensions, but doesn’t help Wikipedia very much.) This strategy can work well if you have several people translating to your language, because it’s easy to divide work by topic.

Another strategy is quiet and friendly competition with other languages. Open the statistics for Extensions Used by Wikimedia – Main and sort the table by the “Completion” column. Find your language. Now translate as many messages as needed to pass the language above you in the list. Then translate as many messages as needed to pass the next language above you in the list. Repeat until you get to 100%.

For example, here’s an excerpt from the statistics for today:

MediaWiki translation stats example

Let’s say that you are translating to Malay. You only need to translate eight messages to go up a notch (901 – 894 + 1). Then six messages more to go up another notch (894 – 888). And so on.

Once you’re done, you will have translated over 3,400 messages, but it’s much easier to do it in small steps.

Once you get to 100% in the main extensions, do the same with all the Extensions Used by Wikimedia. It’s over 10,000 messages, but the same strategies work.

Good Stuff to Do Along the Way

Never assume that the English message is perfect. Never. Do what you can to improve the English messages.

Developers are people just like you are. They may know their code very well, but they may not be the most brilliant writers. And though some messages are written by professional user experience designers, many are written by the developers themselves. Developers are developers; they are not necessarily very good writers or designers, and the messages that they write in English may not be perfect. Keep in mind that many, many MediaWiki developers are not native English speakers; a lot of them are from Russia, Netherlands, India, Spain, Germany, Norway, China, France and many other countries, and English is foreign to them, and they may make mistakes.

So report problems with the English messages to the translatewiki Support page. (Use the opportunity to help other translators who are asking questions there, if you can.)

Another good thing is to do your best to try running the software that you are translating. If there are thousands of messages that are not translated to your language, then chances are that it’s already deployed in Wikipedia and you can try it. Actually trying to use it will help you translate it better.

Whenever relevant, fix the documentation displayed near the translation area. Strange as it may sound, it is possible that you understand the message better than the developer who wrote it!

Before translating a component, review the messages that were already translated. To do this, click the “All” tab at the top of the translation area. It’s useful for learning the current terminology, and you can also improve them and make them more consistent.

After you gain some experience, create a localization guide in your language. There are very few of them at the moment, and there should be more. Here’s the localization guide for French, for example. Create your own with the title “Localisation guidelines/xyz” where “xyz” is your language code.

As in Wikipedia, Be Bold.

OK, So I Got to 100%, What Now?

Well done and congratulations.

Now check the statistics for your language every day. I can’t emphasize how important it is to do this every day.

The way I do this is having a list of links on my translatewiki.net user page. I click them every day, and if there’s anything new to translate, I immediately translate it. Usually there is just a small number of new messages to translate; I didn’t measure precisely, but usually it’s less than 20. Quite often you won’t have to translate from scratch, but to update the translation of a message that changed in English, which is usually even faster.

But what if you suddenly see 200 new messages to translate? It happens occasionally. Maybe several times a year, when a major new feature is added or an existing feature is changed.

Basically, handle it the same way you got to 100% before: step by step, part by part, day by day, week by week, notch by notch, and get back to 100%.

But you can also try to anticipate it. Follow the discussions about new features, check out new extensions that appear before they are added to the Extensions Used by Wikimedia group, consider translating them when you have a few spare minutes. At the worst case, they will never be used by Wikimedia, but they may be used by somebody else who speaks your language, and your translations will definitely feed the translation memory database that helps you and other people translate more efficiently and easily.

Consider also translating other useful projects: OpenStreetMap, Etherpad, Blockly, Encyclopedia of Life, etc. Up to you. The same techniques apply everywhere.

What Do I Get for Doing All This Work?

The knowledge that thanks to you people who read in your language can use Wikipedia without having to learn English. Awesome, isn’t it? Some people call it “Good karma”.

Oh, and enormous experience with software localization, which is a rather useful job skill these days.

Is There Any Other Way in Which I Can Help?

Yes!

If you find this post useful, please translate it to other languages and publish it in your blog. No copyright restrictions, public domain (but it would be nice if you credit me and send me a link to your translation). Make any adaptations you need for your language. It took me years of experience to learn all of this, and it took me about four hours to write it. Translating it will take you much less than four hours, and it will help people be more efficient translators.

Versions of this post were already published in the following languages:

I’m deeply grateful to all the people who made these translations; keep them coming!

23 October, 2020 04:39 PM

02 October, 2020

Gilad Ben-Yossef

תלות גומלין

השליט העליון שכב במיטת בית החולים. הוא התקשה לנשום והתקשה לחשוב. את מעט הריכוז שעוד הצליח לגייס הפרו הצפצופים הדחופים של מכונות הניטור והחמצן. המחלה הארורה השיגה אותו לבסוף. כמו שהזהירו המדענים, החיסון לא עבד. הוא שמח כשנזכר שהורה על הוצאתם להורג. "מה הטעם במדענים", חשב לעצמו בלעג, "אם אינם מועילים בריפוי המגיפה?"

לאט לאט, הנהן בראשו להסכמה. הרופאים ביקשו להרדים ולהנשים אותו. לא היתה ברירה, הם אמרו. בלי זה, הוא לא ישרוד את הלילה. הנהונו גרם לפרץ של פעילות. רופאים ואחיות החלו בשרשרת של סידורים. השליט לא סמך על רופאות ואסר על לימודי רפואה לנשים כבר לפני שנים רבות.

לבסוף שככה הפעילות ורופא זקן ניגש אליו. השליט העליון לא ראה את הרופא הזה קודם אך על פי יחס שאר אנשי הצוות אליו השליט העליון הבין שהוא רופא בכיר. השליט העליון היה טוב מאוד בלקרוא אנשים ומצבים. משהו הטריד אותו ברופא הזה. הרופא הזקן התכופף. השליט העליון הבחין בתואר "פרופסור" על תג השם שלו, אבל לא הצליח להתרכז מספיק כדי לקרוא את השם המלא. הוא לא אהב פרופסורים.

הרופא הזקן הביט בשליט העליון ואז, מבלי להסיר את עיניו ממנו, הנהן. רופא אחר, צעיר יותר, נחפז אל השליט העליון והוא חש דקירה בזרועו. הרופא הזקן נפנף והרופא הצעיר התרחק במהירות.

השליט העליון חש לפתע קור. "מה זה?" ,חשב, "מישהו פתח את החלון?". לא הייתה זאת מחשבה הגיונית, כך ידע, אבל הוא מצא שקשה לו עוד יותר להתרכז. הוא חש עייף. הרופא הזקן התקרב עוד יותר אליו, הביא את פיו לאוזנו, ואמר משהו. השליט העליון ניסה מאוד להתרכז להבין מה נאמר. זה היה קשה מאוד. לבסוף הבין. פיו נפער, אבל אף בת קול לא יצאה. עיניו נעצמו.

"Sic Semper Tyrannis"

02 October, 2020 08:11 AM

10 June, 2020

hatul

המדריך של חתול להתקנת ארץ׳ לינוקס

אני מודע לכך שלא כתבתי יותר משש שנים ואני מקווה שמישהו עוד עוקב אחרי הבלוג. אבל לאחרונה קניתי מחשב חדש וכמובן שהתקנתי עליו ארץ׳ וחשבתי שתיאור התהליך יוכל לעזור למישהו. לי לפחות יוכל לעזור בעתיד לדעת מה בדיוק עשיתי.

למרות הכותרת המפוצצת, לא מדובר על מדריך מלא עם הסברים ובטח לא על מדריך פשוט של העתק־הדבק. חשוב להבין מה אתם עושים ובמחשבים אחרים ייתכן שהפקודות יצטרכו להיות שונות.

בהתקנה התבססתי על שני מדריכים עיקריים:

בתור התחלה, הורדתי את תקליטור ההתקנה של ארץ׳, „צרבתי” אותו על החסן נייד והעליתי את המחשב ממנו.

התחברות לרשת האלחוטית

wifi-menu

או שמתחברים עם כבל לרשת קווית

בדיקה שמחובר:

ping -c3 google.com

עדכון שעון מערכת

timedatectl set-ntp true

חלוקת מחיצות עם fdisk

אצלי כבר היה מותקן אובונטו מהיצרן ולכן השארתי את שתי המחיצות הראשונות של uefi ומחיצת שחזור ומחקתי את המחיצה של אובונטו

fdisk /dev/nvme0n1

יצרתי מחיצה ל־swap של 24G, מחיצת שורש של 30G ומחיצת בית של 175G שנשארו (לפי הסדר הזה)

mkswap /dev/nvme0n1p3
swapon /dev/nvme0n1p3
mkfs.ext4 /dev/nvme0n1p4
mkfs.ext4 /dev/nvme0n1p5

הגדרת מקורות

pacman -Sy reflector
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
reflector -c "IL" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist

עיגון

mount /dev/nvme0n1p4 /mnt
mount /dev/nvme0n1p5 /mnt/home

התקנה

pacstrap /mnt base linux linux-firmware nano intel-ucode

הגדרת fstab

genfstab -U /mnt >> /mnt/etc/fstab

ביצוע chroot

arch-chroot /mnt

הגדרת אזור זמן

ln -sf /usr/share/zoneinfo/Asia/Jerusalem /etc/localtime
hwclock --systohc

הגדרת locale

nano /etc/locale.gen
en_US.UTF-8 UTF-8
he_IL.UTF-8 UTF-8
locale-gen

הגדרת רשת

echo myname > /etc/hostname
nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 myname.localdomain myname

הגדרת סיסמה

passwd

התקנת grub

pacman -S grub efibootmgr
mkdir /boot/efi
mount /dev/nvme0n1p1 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

יצירת משתמש

useradd -s /bin/bash -g users -G sys,adm,wheel -m user
passwd user

התקנת ממשק גרפי

pacman -S xorg-server xf86-video-intel
pacman -S eog evince file-roller gdm gedit gnome-calculator gnome-color-manager gnome-control-center gnome-disk-utility gnome-font-viewer gnome-keyring gnome-logs gnome-menus gnome-screenshot gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-system-monitor gnome-terminal gvfs gvfs-gphoto2 gvfs-mtp mutter nautilus networkmanager simple-scan totem xdg-user-dirs-gtk

לא כל גנום חובה, חלק אני רציתי

להפעיל את השירותים

systemctl enable gdm NetworkManager

הרשאות ניהול

pacman -S sudo
nano /etc/sudoers
%wheel ALL=(ALL) ALL

התקנת yay

pacman -S base-devel wget
wget https://aur.archlinux.org/cgit/aur.git/snapshot/yay-bin.tar.gz
tar -xzf yay-bin.tar.gz
cd yay-bin
makepkg -si

התקנת גופנים לעברית

קצת סיפור להוריד ולבנות את החבילה של הגופנים אז אפשר להוריד אותה מדרייב:

pacman -U ttf-ms-win10-10.0.18362.116-2-any.pkg.tar.xz
yay -S culmus culmus-fancy-ttf ttf-alef

התקנת דפדפנים

pacman -S firefox-i18n-he chromium

התקנת ליברה אופיס

pacman -S libreoffice-fresh-he

עוד כמה תוכנות חשובות בעיני (חלק צריך להגדיר)

libhdate-glib vlc mlocate reflector zsh zsh zsh-completions zoom parcellite

וזהו

reboot

אם התקנתם הכול נכון אז המערכת תעלה ותוכלו להינות ממנה. בהצלחה!

10 June, 2020 10:03 AM

26 May, 2020

Kaplan Open Source Consulting

סדנאות QGIS ביוני 2020

ביחד עם משבר הקורונה, אנשים רבים גילו כי לצד העבודה מהבית הרישיון לתוכנות ה-GIS שלהם נשאר במשרד. סדנאות ה-QGIS שלנו מיועדות למי שרוצה להשתחרר ממגבלות עולם ה-GIS הקנייני ולעבוד עם תוכנה ללא מגבלות על שימוש והתקנות וזאת מבלי לוותר על יכולות של התוכנה.

לצד סדנה בהתאמה אישית לארגונית (דרך zoom בתקופת הקורונה) המאפשרת גמישות מקסימלית של התכנים, אנחנו מפעילים סדנאות חודשיות עם תוכן קבוע. סדנאות QGIS שלנו ביוני 2020:

  1. מה זה QGIS ופלאגאין עבור מידע ישראלי פתוח (17 ביוני, דרך Zoom)
  2. סדנת מבוא ל-QGIS (14 ביוני, דרך Zoom)
  3. סדנת QGIS למתכנני ערים (15 ביוני, דרך Zoom)

סדנאות המבוא מיועדות לאנשים שרוצים לעבוד עם מפות ולבצע ניתוחים מרחביים במסגרת תחומי העיסוק שלהם: כלכלנים, מהנדסות, אדריכלים, מתכננות ערים, אקולוגים, ארכיאולוגיות, גיאולוגים ועוד. הן מיועדת גם למי שלא מכיר GIS או מכיר ברמה בסיסית.

ניתן להשאיר פרטים בטופס ההתעניינות ונחזור אליכם עם פרטים וכיצד להרשם או להצטרף לניוזלטר החודשי שלנו כדי לקבל עדכונים על סדנאות עתידיות.

26 May, 2020 10:15 AM

12 April, 2020

Gilad Ben-Yossef

זכרונות מגלגול קודם בגלקסיה רחוקה

בכנס אייקון 2019 נתתי הרצאה על השורשים הבודהיסטים וטאואיסטים של מסדר הג'די מסדרת סרטי מלחמת הכוכבים. ההרצאה ההיא לא הוקלטה אבל בצוק העיתים וברוח הנדיבות עשיתי שחזור שלה בזום עם כמה א.נשים אמיצים והנה התוצאה לפניכם.

בהרצאה משולבים מספר קטעים קצרים (לצד הסברים שלי) מסדרת הסרטים והזכויות להם שייכים כמובן לחברת דיסני. השימוש בקטעים הוא לצרכי ביאור ונעשה בהבנה שהשימוש נופל תחת החרגת השימוש ההוגן של חוק זכויות היוצרים הישראלי.

מעבר לכך בסוף ההרצאה יש קטע בונוס מיוחד – גילוי של גלגולו הנוכחי של יודה, כאן ועכשיו!

תהנו!

12 April, 2020 03:08 PM

15 March, 2020

Rabin Yasharzadeh

Hot To Generate a Custom Color Palette For Cacti Aggregated Graphs

I had a use case where I wanted to colorizes an aggregated graph with a nice gradient color, so I looked to see how to add a new color template to Cacti, but the process is not usable when one need to add a lot of colors, in my case I was looking to add 110 different colors, and using the webUI was not a options. So I looked on the database schema and found that the color template is managed by 3 tables. One manage the template names plugin_aggregate_color_templates, and the other plugin_aggregate_color_template_items is a pivot table which manage the colors per template by referencing the colors table and the plugin_aggregate_color_template table.

cacti-color-template-tables

Cacti Database Tables Related To Colors

Create a color Palette

First thing first we need to add our new colors to the colors table, so I looked a bit and found this nice website which allow you to set few colors and define the number of steps between the colors, and I used another site to find a nice palette for “fire” colors. The cool thing for was that the site will auto generate an PHP array snippet which you can copy and use.

strangeplanet.fr

The Code

Now we can write a small script which will take the array and generate a new color templates for us

15 March, 2020 11:17 PM

06 December, 2019

Itzik Kotler

Don't Let Your Fear Of Nation-State Hackers Blind You

Mr. Magoo is an old cartoon character famous for his inflated sense of status and an extreme case of myopia, made worse by his refusal to wear corrective glasses. As a result of his poor vision and ego, Magoo would find himself in precarious — and hilarious — situations because he was unable to see the danger right in front of him. Typically, the oblivious Magoo would leave a trail of destruction behind him..

Enterprises today approach security a lot like Mr. Magoo, operating with the idea that they are more important than they really are and therefore are unable to see the real risks that beset them. The result? A lot of unnecessary damage.

Read the full article at Forbes here

Full text

06 December, 2019 09:24 PM

19 November, 2019

Rabin Yasharzadeh

Using Ansible To Manage Trust-Point Certificates In Cisco ASA

For some time now, I was looking for a way to Integrate Let’s Encrypt (LE) with My Cisco ASA, and use LE to issue the certificates for the VPN. And now Ansible is in a good place with its Network Modules to allow this without much of a problem.

I won’t go over the procedure of how I issue/renew the certificates, I will just mention that I use the DNS alias option, as I find it the most useful option, as it doesn’t require me to punch holes in my firewall to allow incoming connection to validate the requests.

My Playbook looks like this,

---
# see:
# - https://docs.ansible.com/ansible/latest/modules/asa_config_module.html
# - https://docs.ansible.com/ansible/latest/modules/asa_command_module.html

- name: Config CiscoASA
  hosts: CiscoASA
  connection: network_cli
  gather_facts: false
  become: true
  become_method: enable
  vars:
    ansible_user: ansible
    ansible_password: "in line or use vault!"
    cert_file: "vpn.pfx"
    cert_pass: "in line or use vault!"
    config_file: "asa.conf"

  tasks:

    - name: Get Certificate
      set_fact:
        cert: >
          {{ (lookup('file', cert_file) | b64encode | regex_replace('(.{1,64})', '\1|')).split('|') | list + [ 'quit' ] }}
      tags: [ cert ]

    - name: Create A TrustPoint
      asa_config:
        lines:
          - crypto ca trustpoint SSL-Trustpoint-Ansible
        after:
          - enrollment terminal

    - name: Import A New Certificate Into The TrustPoint
      asa_config:
        replace: block
        parents: "crypto ca import SSL-Trustpoint-Ansible pkcs12 {{ cert_pass }} nointeractive"
        lines: "{{ cert }}"
      notify:
        - Set SSL Trust-Point

  handlers:

    - name: Set SSL Trust-Point
      asa_config:
        save: true
        lines:
          - ssl trust-point SSL-Trustpoint-Ansible inside
          - ssl trust-point SSL-Trustpoint-Ansible outside

Extra

Generate PFX from Cert and Key

#!/bin/bash

CA=ca.cer
#fullchain.cer
CER=vpn.cer
KEY=vpn.key
OUT=vpn.pfx

openssl pkcs12 -export \
-inkey ${KEY} \
-in ${CER} \
-certfile ${CA} \
-out ${OUT}

19 November, 2019 09:52 AM

24 October, 2019

Arie Skliarouk

MYSQL/BTRFS/NVME failure

It is a very bad idea to run database (especially production one with lots of I/O) on BTRFS because the filesystem at any random time might become readonly:

Oct 24 12:30:22 db02 kernel: BTRFS: error (device nvme0n1) in btrfs_run_delayed_refs:2936: errno=-28 No space left
Oct 24 12:30:22 db02 kernel: BTRFS info (device nvme0n1): forced readonly
And then you find that you need to do rebalance. You try and find out that rebalance can not be done because - you guessed it - there is no space left. They suggest to delete couple of snapshots though. You delete them, start rebalance and now the whole filesystem is stuck completely.

If you need HA mysql db with snapshots, then you should go with mysq/LVM/DRBD path, see this link for insight: https://rarforge.com/w/index.php/2_Node_Cluster:_Dual_Primary_DRBD_%2B_CLVM_%2B_KVM_%2B_Live_Migrations

24 October, 2019 03:02 PM

23 September, 2019

Itzik Kotler

Demystifying Criminal Hackers

As I write these pieces for Forbes Tech Council, I’ve tried to chip away at the Hollywood reputation that hackers have been given over the years. That reputation often keeps people from making good decisions about how to protect their networks and data, keeps people focused on the wrong security priorities, and causes people to give up before the game is over.

It’s important to keep in mind, however, that while criminal hackers may be smart and devious, they are also, in a sense, entrepreneurs who are in the game to make a quick buck. As such, they realize that hacking costs money and so they will do what they can to keep their operating costs low. Why, then, would you expect a criminal hacker to expend time and money developing specialized tools when there are easier ways to get to what they want?

Read the full article at Forbes here

Full text

23 September, 2019 11:38 PM

31 July, 2018

Lior Kaplan

Debconf18 – יום ראשון

את היום הראשון של הכנס פתחתי כרגיל בדוכן הרשמה (front desk) והייתי שם עד הצהרים כדי שהצוות ירשום את הגל אנשים שהגיעו.

לצערי הכנסים של דביאן נפתחים מאוד בעצלתיים מבחינת תוכן – יש הרצאת/טקס פתיחת ואחרי אין ישר רצף גדול של הרצאות אלא טפטוף קטן של נושאים והרצאות. קצת מאכזב מבחינתי. ומצד שני, אפשר לי להתחיל לעבוד על החבילות של עברית בדביאן בלי לדאוג לפספס תוכן כלשהו. אבל לפני שאפשר לעבוד על החבילות, צריך לייצר סביבה מתאימה. לקח לי זמן להוריד חלודה לגבי מה צריך, ואיך לייצר משהו שיודע לבנות בתוך chroot (גם כדי שהבניה תהיה נקייה, וגם כי אני משתמש ב-testing בעוד שהבניה נעשית ב-unstable). בעזרת כמה תזכורות מ-Bálint הכל הסתדר, ויש סביבה עובדת עם sbuild.

השלב השני היה להתחיל להמיר את ההיסטוריה של הצוות מ-SVN ל-GIT ואז לדחוף את זה לשרת ה-GitLab החדש של דביאן. עשיתי את זה בנפרד עבור כל חבילה, כאשר הראשונה בתור היא Hspell כי צפריר הספיק להכין את הרוב מראש. ואחר כך עבדתי על המרת Culmus כי לא הייתי רוצה שהגרסה הבאה תצא בלי פונטים בעברית (על הדרך כבר הועלתה גרסה 0.132). כל המאגרים זמינים תחת Debian Hebrew Packagers בכתובת https://salsa.debian.org/hebrew-team . למי שצריך לעשות משהו דומה, הכלי להמרה היא git svn clone ואפשר להשתמש בהוראות שיש באתר git-scm.com בכתובת https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git . על בסיס הפקודות שלהם עוד עשיתי כמה שינויים קלים, אבל החלקים החשובים נמצאים שם.

בין לבין שמעתי את הדיווח השנתי של Chris Lamb במסגרת תפקידו כ-Debian Project Leader. בין השאר גיליתי שם כי דביאן תחגוג השנה יום הולדת 25 באמצע אוגוסט, וישר החלטתי לפתוח event כדי לחגוג עם עוד אנשים. נתראה שם בקרוב (: בנוסף, גיליתי כי המעבר של דביאן ל-GitLab נובע בין השאר גם מהשינוי שלהם בנושא ה-Content License Agreement ושינוי ל-Developer Certificate of Origin מה שמאפשר ליותר אנשים לתרום קוד בלי לוותר על הזכויות שלהם או לקרוא מסמך משפטי כבד. שאפו ל-GitLab, ואיזה כיף לעבור לעבוד במערכת מתקדמת.

31 July, 2018 02:40 PM

29 July, 2018

Lior Kaplan

Debconf18 – קדם כנס

הכנס השנתי של דביאן, Debconf, מתקיים השנה בפעם הראשונה באסיה (Hsinchu, Taiwan). הישג מכובד לאחר שנים של אירופה / ארה"ב ולפעמים דרום אמריקה. וגיוון מבורך בהמשך לכנס בדרום אפריקה לפני שנתיים. כלומר הפעם טסים לכנס מזרחה ולכן גם כולם סובלים מג'ט לג חמור יותר. לצערי זה גם גרם לי לתרום הרבה פחות בדוכן הרשמה (front desk) למרות שזה אחת ההתנדבויות הקבועות שלי.

היום הפתוח התנהל בחלקו בסינית, כך שאפילו לא ניסיתי ללכת להרצאות (גם לבודדות שהיו באנגלית), ובמקום זה התמקדתי בקצת שיחות עם אנשים (למרות העייפות). הספקתי לדבר עם Bálint Réczey שעובד עבור Canonical בצוות Ubuntu Foundation שאחראי על הסנכרון עם דביאן והתרומה של שינויים לקהילה. גם ניצלתי את ההזדמנות כדי לשמוע באיזה כלים הם משתמשים בפעילות, כדי לתזכר את עצמי. אחרי כמעט שנה שלא נגעתי בחבילות, אני בהחלט חלוד (וגם צריך לסדר את סביבת העבודה על המחשב). אגב, קנוניקל מחפשים אנשים עובדים, אם מישהו מתעניין, צרו קשר בפרטי (יש אפשרות לעבוד מרחוק, ואוכל לעזור בסידורים הנדרשים).

בהמשך הערב ישבתי על באג שדיווח לקוח על פיצ'ר של PHP שלא עובד לו מול OpenSSL. תפסתי את Kurt Roeckx שאחראי על החבילה בדביאן וגם עושה עבודת upstream בכמה שנים האחרונות כדי לבדוק את הנושא. אחרי קצת שאלות מולו ובדיקות שלי הסתבר שהבעיה היא לא ב-OpenSSL אלא ב-PHP, ואחרי מספיק חיטוטים בקוד נפתח באג #76676.

לאורך היום יצא לי להכיר את הלן (Helen Koike), בחורה נחמדה שסיפרה שהיא לא מעורבת מאוד בדביאן, ובאה ללמוד קצת כי היא הולכת לעזור לצוות המארגן של שנה הבאה. תייגתי אותה כעוד מישהי שעושה עבודה כללית ולא משהו טכני (הקהילה מורכבת גם מכאלה) והמשכתי הלאה. יותר מאוחר בערב, בשיחה רנדומלית גיליתי שהיא עשתה פעילות על הקרנל במסגרת Outreachy, תרמה דריברים, עובדת ב-Collabora בצוות שמתעסק עם הקרנל וכו'. היא פשוט צנועה לאללה. ניסיתי לדחוף אותה לתרומה בצוות קרנל של דביאן והיא אמרה שהיא לא יודעת לארוז חבילות. הסברתי לה שהיא יודעת לתקן באגים בקרנל, וזה תרומה משמעותית לצוות. בנתיים מישהו אחר יכול לארוז. ויותר חשוב לתקן באגים.

במקביל, למדתי כמה מהר אנחנו מתייגים אנשים לפי המקום שנוח לנו לתייג אותם. ומצד שני, שיש אנשים (ויתכן שבעיקר נשים) שהם סופר צנועים ולא מספרים על כל הפעילות והיכולות שלהם וכך דברים מתפספסים (ברושם הראשוני ומעבר).

לסיום הערב, עשיתי תיאום עם צפריר לגבי החבילות של עברית בדביאן שדורשות תשומת לב בעקבות מהעבר מ-Alioth ל-Salsa שעל הדרך סגר את רשימות התפוצה הצוותיות וגם מכריח את כולם לעבור ל-GIT. כאשר המטרה היא לעשות את המיגרציה, לתקן את הבאגים שדווחו מולן כתוצאה מכך, שגם מונעים מהן להכנס ל-testing (ולכן לגרסה הבאה של דביאן). והדבר משמעותי, כי תהליכי ה-freeze מתחילים בספטמבר. בסופו של דבר, אני הולך להקדיש את הזמן לחבילות, בעוד שצפריר יתעסק בדברים אחרים שלו. שזה סה"כ הוגן, כי במהלך השנה לא יצא לי לתרום כלום לתחזוקת החבילות האלה.

מי שרוצה לעקוב אחרי הכנס מרחוק, אז הלוח זמנים נמצא בכתובת https://debconf18.debconf.org/schedule, רק לא לשכוח שהכנס מתקיים באזור זמן +8, כלומר 5 שעות לפני ישראל (ריאלית, אפשר לצפות בהרצאות של אחרי ארוחת הצהריים כאן, שזה 9 בבוקר בישראל).

29 July, 2018 04:17 PM

05 March, 2018

Lior Kaplan

Running for OSI board

After serving in the board of a few technological Israeli associations, I decided to run as an individual candidate in the OSI board elections which starts today. Hoping to add representation outside of North America and Europe. While my main interest is the licensing work, another goal I wish to achieve is to make OSI more relevant for Open Source people on a daily basis, making it more central for communities.

This year there are 12 candidates from 2 individual seats and 5 candidate for 2 affiliate seats (full list at OSI elections wiki page). Wish me luck (:

Full text

05 March, 2018 09:37 AM

28 November, 2017

Lior Kaplan

AGPL enforced: The Israeli ICT authority releases code

Data.gov.il was created in 2011 after the Israeli social justice protests as part of the the public participation initiative and started to offer data held by the government. Back then the website was based on Drupal. In 2016 it was changed to CKAN, a designated system for releasing data. This system is licensed under the AGPLv3 requiring source code availability for anyone who can access the the system over a network, de facto for every user.

Since the change to CKAN, open source people asked the state to release the code according to the license but didn’t get a clear answer. All this time when it’s clear it’s violation.  This led Gai Zomer to file a formal complaint in March 2017 with the Israeli State Comptroller. Absurdly, that same month the ICT authority mentioned a policy to release source code it owns, while failing to release code it has taken from others and adapted.

With the end of the summer break and Jew holidays, and after I wasn’t able to get the source, I decided to switch to legal channels, and with the help of Jonathan Klinger and my company, Kaplan Open Source Consulting, we notified they should provide the source code or we’ll address the court.

Well, it worked. In 3 days time the CKAN extensions where available on the website, but in a problematic way, so users weren’t able to download easily. This is why we decided not to publish this code release and let them fix it first. In addition we made it clear all the source code should be available, not only the extensions. Further more, if they already release it’s recommended to use git format instead of just “dumping” a tarball. So we told them if they aren’t going to make a git repository we’ll do that ourselves, but in any case, would prefer them to do that .

While this issue is still pending, the ICT authority had a conference called “the citizen 360” about e-gov and open government in which they reaffirmed their open source plans.

A slide about open source from the Israeli ICT authority presentation

A slide about open source from the Israeli ICT authority presentation

Now, a month later, after our second letter to them, the about page in data.gov.il was updated with links to the ICT authority GitHub account which has the sources for the website and the extensions. A big improvement, and an important mark point as the commit to the repository was done by an official (gov.il) email address.

Beyond congratulating the Israeli ICT authority for their steps forward and the satisfaction of our insisting on them became fruitful, we would like to see the repository get updated on a regular basis, the code being given back to the various CKAN extensions (e.g. Hebrew translation). In general, we hope they would to get inspired by how the how data.gov.uk is doing technical transparency. If we allow ourselves to dream, we would like to see Israel becoming a dominate member in the CKAN community and among the other governments who use it.

We’re happy to be the catalyst for open source in the Israeli government, and we promise to keep insisted where needed. We know that due to other requests and notifications more organizations are on their way to release code.

(This post is a translation from Hebrew of a post in Kaplan Open Source Consulting at https://kaplanopensource.co.il/2017/11/20/data-gov-il-code-release/)

Full text

28 November, 2017 09:07 AM

18 June, 2017

Amir Aharoni

סיסמה

אז לפתע פתאום האקדמיה ללשון שינתה את כללי הכתיב.

הופתעתי מאוד מהשינוי של היום. אולי היו על זה ידיעות בפרסומים של האקדמיה, אבל למרות שאני מתעניין בלשון בכלל, ובכללי הכתיב בפרט, אינני עוקב אחרי כולם. למשל, בדיוק לפני מספר חודשים האקדמיה ללשון הקטלאנית הודיעה שהיא מתכננת לפשט את כללי הכתיב ולבטל הרבה מהסימנים מעל האותיות, אבל היא פרסמה טיוטה לדיון ציבורי, ולא הודיעה ישר על השינוי. (ויש דיון ציבורי, כי לאנשים אכפת מזה.)

אילו האקדמיה ללשון העברית פרסמה טיוטה, הייתי מעיר כמה דברים. אני אישית לא אוהב את הגושפנקה שניתנה ל„שיער”, „בריכה”, „ברירה”, ו„עבירה”, אבל בסדר, אני מבין שזה נפוץ, ואני אפילו שמח מאוד שאני לא צריך לבזבז את העצבים שלי על ויכוחים בנושא הזה. עם זאת, הכתיב החדש „מייד” מצער: גם הכתיב „מיד” היה נפוץ למדי, ולא עורר הרבה מחלוקות, והוא שמר על הקשר למילה „יד”.

אני הקפדתי מאוד על „ססמה” בתרגומי פיירפוקס וטוויטר, למרות התנגדויות רבות, ועכשיו זה בהדרגה יהפוך ל„סיסמה”. על זה לא חבל לי כל־כך, כי זאת ממילא מילה שאולה מובהקת, גם אם עתיקה, ואם אתם שואלים אותי, אפשר להוסיף יו״ד גם למילים שמיות מובהקות כמו פסגה, קדמה, וכיו״ב.

טיפ־טיפה חבל לי על הכתיב „שמים”, שעכשיו הפך ל„שמיים”. היה בזה דמיון יפה ל„מים”, אבל בסדר. עכשיו אני יכול להפסיק להחרים את יישום „ירושמיים”, שהפכה כבר מזמן למשהו פולחני עבור ירושלמים רבים.

אני מרוצה מהשינוי של „תכנה” ו„יזמה” ל„תוכנה” ו„יוזמה”. אני גם מרוצה למדי מהשינוי של מילות היחס „אתי, אתך” ל„איתי, איתך”, ושל „עתים” ל„עיתים”, אבל מוזר לי ביותר שלא נוספה בהזדמנות הזאת האות יו״ד למילים כמו „אִגרוף” ו„מִחזור”, כדי לא להתבלבל עם „אֶגרוף” ו„מַחזור”. זה היה יכול להיות כלל פשוט ושימושי, והוא ממש לא היה אמור להיות שנוי במחלוקת. חבל שזה התפספס.

עוד משעשעים אותי ה„אישורים” שנינתו למילה „אומנם” וליו״ד בצורת הגוף הראשון בזמן עתיד בבניין נפעל, למשל „איכנס” במקום „אכנס”. אני תמיד כתבתי אותם בכתיב מלא. את „אומנם” כתבתי בווי״ו כי גם „אֻמנם” הוא ניקוד תקני ולא רק „אָמנם”, וצליל u תמיד אמור להיכתב בווי״ו (אם כי עכשיו גיליתי לראשונה שהניקוד „אֻמנם” מיועד לשאלות, לפחות לפי אבן־שושן). ובבניין נפעל כתבתי תמיד „איכנס”, „איזהר”, וכו׳, כי הניקוד בחיריק תקין כמו בניקוד בסגול (ר׳ למשל גזניוס 51p).

טוב שיש עכשיו גושפנקה למילה „תיאטרון”, כי אני לא מכיר שום תיאטרון ישראלי שבכניסה עליו כתוב „תאטרון”. (אם יש כזה, זה מפדח למדי, אז עדיף שפשוט אודה: אני לא הולך להצגות מספיק.) מצד שני, מוזאון עדיין אמור להיכתב בלי יו״ד. אני אוהב את החלוקה החדשה הזאת, אבל יש לי תחושה שמוזאונים ימשיכו לקרוא לעצמם „מוזיאונים”, אם כי אפשר לשם השעשוע לנסות להחיות את המילה „בית נכאת”.

מעטים ישימו לב לזה, אבל עכשיו המילה „די” תיכתב תמיד ביו״ד אחת. גם ככה רוב האנשים כותבים אותה ביו״ד אחת, וזה תמיד היה נכון, אבל משום־מה האקדמיה אפשרה עד עכשיו גם „דיי” ו„דאי”. אפילו ראיתי את „דיי” בספרים שהאקדמיה הוציאה ממש לאחרונה (כמו „העברית בתקופת המנדט” הנהדר של יעל רשף). אבל זהו, לא עובד: רק „די”, וטוב שכך.

עוד דבר שמעטים ישימו לב אליו הוא השם של הכללים החדשים: „כללי הכתיב המלא”. עד עכשיו הם נקראו „כללי הכתיב חסר־הניקוד”. למיטב ידיעתי, המונחים כתיב מלא וכתיב חסר מעולם לא היו מוגדרים באופן מדויק למרות שאנשים רבים השתמשו בהם. „כתיב חסר” עדיין אינו מוגדר, אבל זה בסדר, כי הוא לא ממש נחוץ.

עכשיו יהיה ממש נחמד לעדכן גם את מילון האיות החופשי Hspell. נדב ודן, אם אתם קוראים את זה, אני אשמח לעזור.

18 June, 2017 11:03 AM

18 October, 2016

PyCon Israel

Pycon Israel 2016 wrap up

A little less than six months ago, we held the first PyCon in Israel. To our dismay, it took us this long to post all the videos from the event, but now they’re finally up, and you can finally catch up on The Track Not Taken.

We’d like to take this opportunity to clear the 2016 table and summarize the conference, to give it some closure.

The conference was a lot of work and fun to organize, and truly wonderful to witness. We’ve had:

Over and beyond the hard data, there was a great feeling of a community coming together.

There’s a few points we want to discuss in more details:

Diversity

We made a conscious effort to make the conference more welcoming to diverse populations. This included a well-defined Code of Conduct, as well as reaching out to specific communities, which are usually underrepresented in technical conferences. This included, of course, the cooperation with Django Girls Tel Aviv, who were invited to the conference; we did not collect the statistics of visitor gender, but we have reason to believe it was significantly more balanced than usual. We also reached out to some other groups who were less clearly visible. By all the feedback we got, everybody felt very welcome.

To our regret, we could not show the same level of diversity among the speakers. Only 3 of the 32 accepted talks were presented by women, and none of these were Israeli. Further, we did not have a travel-support plan for speakers, and partly as a result of that, we did not have any speaker from the less-privileged parts of the world. We still have some way to go there.

We intend to keep pursuing diversity in future editions of PyCon Israel.

Budget

In the spirit of Open Source and transparency, we’re happy to share a summary of our budget (all numbers are thousands of Shekels).

Income

Sponsorship: 246

Ticket sales: 54

Total: 300

Expenses

Venue (incl. food): 134

Conf. party (food+movie): 41

Keynote speakers travel: 30

Speaker’s dinner: 13

Video recording & editing: 20

T-shirts & other swag: 28

Wireless internet: 5

Various other: 3

Total: 274

As you can see, we ended with a positive balance of close to 26K ILS. This is more than we intended, a miss we attribute to over-cautiousness and inexperience. A small part of this surplus will go to support Hamakor, the Israeli F/OSS association which helped make the conference happen, and the rest will go into the budget of the next PyCon Israel.

Community organizations

We’d like to call out three special groups which could use your help — participation as well as sponsorship; groups whose ongoing work enabled this conference and will hopefully enable others like it in the future:

2017

Since so long has passed, we can also add a look to the future: Preparations for PyCon Israel 2017 have already started! You can join the organizing team, or just keep track of our progress via our different channels -

Blog: https://medium.com/@pyconil

Twitter: @pyconil, #pyconil

YouTube channel: https://www.youtube.com/channel/UC8ApA9ibgkf0XK7lgTVZgEQ

Facebook: https://www.facebook.com/pyconisrael/

Google group: https://groups.google.com/forum/#!forum/pycon-israel (requires registration)

Website: http://il.pycon.org/

Final words

Watching the months of preparations come to full fruition made our hearts burst with joy. We’d like to thank everyone involved — all CFP submission authors, the invited and accepted speakers, the sponsors (and in particular the Diamond sponsors, Red Hat & Cymmetria), the vendors (and in particular the helpful staff of our wonderful venue at Yes Planet), the Israeli Python community in general for making such an event possible, and you, the attendees, for making it a reality.

See you in 2017,

The PyCon Israel organizing team

18 October, 2016 07:45 PM