[LINUX][Fedora41] Issues playing mkv files?

And after some time installing a lot of codecs and VLC still giving me the "could not play hevc H.265" this simple finding solved ...

viernes, 21 de febrero de 2020

CODING > Java 02 Password generator

Definition

As there is nothing more frustrating than create a new random password for everyone in a company, the automated process to do so could be required somewhere.

Summary

In the following script we create a java class "PassGen01" which has three main variables, containing two arrays of words and a random two digit number.

Later we have another two number generator (0 to 3 as the possible positions of the two arrays we have)

Finally, everything is concatenated into the variable "pass" and shown into console through a System.out

Code

public class PassGen01 {
public static void main(String[] args) {

String[] pass_list01 = {"Spring", "Summer", "Autumn", "Winter"};
String[] pass_list02 = {"Day", "Month", "Year", "Decade"};
int pass_num_random = ((int)(Math.random() * (99 - 10) + 10));

int pass_list_index_random01 = ((int)(Math.random() * (3 - 0)));
int pass_list_index_random02 = ((int)(Math.random() * (3 - 0)));

String pass = (pass_list01[pass_list_index_random01])
+ (pass_list02[pass_list_index_random02]) 
+ (pass_num_random) 
+ "!";
System.out.println(pass);
}

}

Results

AutumnMonth25!
SummerMonth95!
AutumnDay77!
AutumnYear65!
SpringYear94!

martes, 18 de febrero de 2020

CODING > Java 01 Start


Starting on Java

Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible.
Java is for many, the starting point on coding as it represents the easy and flexible start as it is used as the base of so many server and desktop based applications

Downloading Java

There are many versions of different code languages and environments, depending if you are gonna use a interpreter for some application already written for any specific language or developing those apps themselves, you would need one or the other.
  • JRE: If you want to run Java programs, but not develop them, download the Java Runtime Environment
  • JDK: To start coding and executing java we would need  the Java Development Kit.
    Link here
At this point there should be some advice:

The Oracle JDK License has changed for releases starting April 16, 2019.

The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle JDK licenses may no longer be available

Apart from the Development kit, you would need as well some environment to start typing your code and run it, test it or break it. For that you need an IDE or Integrated Development Environment, we picked Eclipse

Start coding

After following the main tutorial, we arrive to our first java class / app which returns a classic "Hello World!"
public class HelloWorld {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("Hello world!");
}
}

Links

sábado, 15 de febrero de 2020

CGGA 01 > Introduction


With this post series I want to take coverage over the engine which gave me some delights and nightmares as a daily car for some years; We are talking about a conservative, bottom range, underpowered, brave in the middle range, liter and almost a half vw petrol engine.

My experience

The way I experienced this engine was in an mk6 Volkswagen Golf, a rather unpleasant way cause of the weight to power ratio, clearly being the most dissapointing feature of the car itself.

Just 59 kW / 80 ps for almost 1.300 kg which makes a 0,045 kW/kg power to weight ratio, in comparison, a first generation 1.3 liter Golf weighted as much as 930 kg with 44 kW / 59 hp. That still makes 0.047 kW/kg. Slightly more than the 30 years later model.

Even in this configuration the car manages to be fun to drive on twisty roads due to the light of the front end. It kinda likes to move sideways completely without under or oversteer but tending to understeer given extreme situations. The softnes of the suspension seems to help balancing the weight although. Still need to try with different dynamic setups.

In regarding to maintenance and knowing that this car enjoyed a sporty driving always, the following seems enough to say that we have a robust engine:
  1. Castrol Edge 5w-30 every ~10.000km
  2. new plugs installed and intake plastic union repaired after 80.000 km(union between both pieces that form the intake broke the glue seal/union and created a leak of air in the intake between the throttle body and cilinder head, happened always idling due to the increased vibration, I suppose, and the ECU jumped into emergency mode not allowing to throttle and keeping the engine around 2.000 rpm If my memories are correct).

Wikipedia specs for the weirdos:

The CGGA engine is usually found in the following vehicles:

Audi A2, SEAT Ibiza, SEAT Córdoba, SEAT León Mk1, SEAT Altea, SEAT Toledo, Škoda Fabia, Škoda Octavia II, Škoda Octavia II Tour, Škoda Octavia II FL, Škoda Roomster, Volkswagen Lupo, Volkswagen Polo, Volkswagen Golf, Volkswagen Bora, Volkswagen Jetta, Volkswagen New Beetle

It is a 1.4 liter, inline four cilinder, four valves per cilinder, internal combustion engine. In detail as follows:

  • Engine displacement & engine configuration:
    1,390 cubic centimetres (84.8 cu in) inline-four engine (R4/I4); bore x stroke: 76.5 by 75.6 millimetres (3.01 in × 2.98 in), stroke ratio: 1.01:1 – 'square engine', 347.5 cc per cylinder, compression ratio: 10.5:1
  • Cylinder block & crankcase:
    cast aluminium alloy; five main bearings, die-forged steel crankshaft
  • Cylinder head & valvetrain:
    cast aluminium alloy; four valves per cylinder, 16 valves total, double overhead camshafts (DOHC)
  • Fuel system:
    multi-point electronic indirect fuel injection with four intake manifold-sited fuel injectors
  • ID engine codes, DIN-rated motive power & torque outputsAHW, AXP, AKQ, APE, AUA, BCA, BBY, BKY:
    55 kilowatts (75 PS; 74 bhp) at 5,000 rpm; 128 newton metres (94 lbf⋅ft) at 3,300 rpm
    BUD, CGGA:
    59 kilowatts (80 PS; 79 bhp) at 5,000 rpm; 132 newton metres (97 lbf⋅ft) at 3,800 rpm
    BXW, CGGB:
    63 kilowatts (86 PS; 84 bhp) at 5,000 rpm; 132 newton metres (97 lbf⋅ft) at 3,800 rpmAFH, AFK, AUB, BBZ (discontinued):74 kilowatts (101 PS; 99 bhp) at 6,000 rpm; 126 newton metres (93 lbf⋅ft) at 4,400 rpm

Some other specs:

Engine codesBCABUDCGGA
Manufactured
Golf from model year 200408.03►06.06►---
Golf Plus from model year 200511.04►06.06►---
Golf from model year 2009------07.08►
Golf Plus from model year 2009------02.09►
Emission standardsEU4EU4EU5
Capacitycm3139013901390
OutputkW at rpm55/500059/500059/5000
TorqueNm at rpm126/3300130/4200130/4200
BoreØ mm76.576.576.5
Strokemm75.675.675.6
Compression ratio10.510.510.5
Valves per cylinder444
RONmin.95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)
Injection and ignition systemMotronic ME 7.5.104HV4HV
Firing order1-3-4-21-3-4-21-3-4-2
Exhaust gas recirculationyesnono

martes, 4 de febrero de 2020

CODING > Python I start

Starting on Python

I started messing with Python after seeing a colleague automatize half of his work in networking with Python coding, still learning though but seems promising.

Download Python

Go to Python.org and from there, downloads, select your operative system (windows, mac or Other) and download the installer that most suits your needs. I am going for the windows x86-64 executable installer.

Once that file is downloaded, open it and the installer will ask usual options, I strongly recommend to add python to the windows PATH enviroment variables. (If you are asking what the duck is that, take a look here)

Start coding

Head yourself to open your Python console, in windows, start menu and search for Python. The following was my first approach following the Python documentation.


>>> the_world_is_flat = True
>>> if the_world_is_flat:
...     print("Be careful")
...
Be careful


As a quick explanation, we set a variable the_world_is_flat and tell the program later to type Be careful with a condition, if that variable exists. The result is the last, fifth line.

Links