Sunday, September 6, 2020

Q4OS Goodies

 Dragi drugari i drugarice, mislio sam da je Elementary OS, a potom i novo-otkriveni Linux Lite najbrži i najresponzivniji Linux, ali evo iskustvo me ponovo demantuje, pronašao sam novi sveti gral medju Linux distribucijama, a to je Debian bazirani Q4OS Linux.
Q4OS je jednostavno ultra brz i ultra responzivan, sve radi perfektno. Najbolje merilo kvaliteta operativnog sistema je kad na 1 GB RAM memorije YouTube ne secka.

Antix je brži, ali je previše čudan pa sam se zaustavio kod Q4OS i Kanotix Linuxa.







The Long Term Support release codenamed 'Centaurus' gives you five years of security patches and updates, it will be supported until July 2024 at least.

https://cleanbrowsing.org/filters

The Linux commands series in ongoing. I'm hard at work on a new book that will be, I hope, a great resource to learn how to use Linux and the macOS terminal. I label those "Linux commands", but I use them in macOS all the time. Underlying its beautiful user interface, macOS is a UNIX system, which means it's technically very similar to the GNU/Linux Operating System. You get to use shells like Bash and Zsh (which is the default shell since macOS Catalina was released last year).
Here's a funny story I remember. It was 2004, I was about to purchase my first iBook, the predecessor of the MacBook laptops. At that point I was using Linux exclusively on my desktop computer, and I got the Mac because it was a very beautiful machine, but I wanted to run Linux on it. So the plan was to buy it and then immediately install Linux on it. I was at a local pub I met a friend whose girlfriend owned a Mac. He was a Linux fan as me, and he told me to "try Mac OS X for a week". I absolutely loved Mac OS X, now called macOS, and I never used Linux on a desktop ever again. Just on servers.
Those Linux commands also work on Windows with WSL, the Windows Subsystem for Linux. Something definitely worth checking out if you use Windows!
This week I explored 7 new commands:
Linux commands: top
A quick guide to the `top` command, used to list the processes running in real time
Linux commands: echo
A quick guide to the `echo` command, used to print the argument passed to it
Linux commands: ps
A quick guide to the `ps` command, used to list the processes currently running in the system
Linux commands: ln
A quick guide to the `ln` command, used to create links in the filesystem
Linux commands: find
A quick guide to the find command, used to find files and folders on the filesystem
Linux commands: cat
A quick guide to the cat command, used to add content to a file
Linux commands: touch
A quick guide to the touch command, used to create an empty file
I'm going to keep writing about Linux commands in the next couple weeks until I'll cover all the most important/used ones.
Don't forget that as a subscriber to my newsletter you have access to the 12 books I published about React, Node, JS, Next, Svelte, and much more!
Last week I wrote you that I started publishing my ebooks on Amazon as Kindle books. You can search "Flavio Copes" on Amazon, or you can see them using this link.



The best choices for everyday OS

 https://nxos.org/  ~3GB install dvd


++


https://www.linuxliteos.com/  ~1.4 GB install dvd


https://antixlinux.com/  ~1.1GB install dvd


https://q4os.org/  ~464MB  install dvd

++

The Long Term Support release codenamed 'Centaurus' gives you five years of security patches and updates, it will be supported until July 2024 at least.


 You can download either a lightweight efficient Trinity desktop, or more advanced Plasma desktop edition. Live media allow users to get a quick Q4OS experience, or try it out on a real hardware without installation. If satisfied, an optional installer is available. Use the install-cd media for older 64bit as well as 32bit machines.
 The minimal hardware requirements are defined as follows:
Plasma desktop - 1GHz CPU / 1GB RAM / 5GB disk
Trinity desktop - 300MHz CPU / 128MB RAM / 3GB disk

Installer for Windows

 The easiest way to put Q4OS alongside Windows. Just run the setup guide from within Windows and install Q4OS as easily as any other application. Windows 10/8/7 compatible.



Tuesday, August 25, 2020

Read Write from text in C# CMD Unicode "Ћирилица Караџића Вука"

 https://stackoverflow.com/questions/5750203/how-to-write-unicode-characters-to-the-console


using System;
using System.Diagnostics;
using System.Windows.Forms;
using System.Net.Mail;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;

//Read a Text File
//using System;
//using System.IO;
namespace readwriteapp
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
            String line;
            try
            {
                //Pass the file path and file name to the StreamReader constructor
//                StreamReader sr = new StreamReader("d:\\config2.ini", Encoding.Unicode, true);
                StreamReader sr = new StreamReader("d:\\config2.ini");
                //Read the first line of text
                line = sr.ReadLine();
                //Continue to read until you reach end of file
Console.OutputEncoding = System.Text.Encoding.UTF8;
                while (line != null)
                {
                    //write the lie to console window
                    Console.WriteLine(line);
                    //Read the next line
                    line = sr.ReadLine();
                }
                //close the file
                sr.Close();
                Console.ReadLine();
            }
            catch(Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }
    }
}

//static void Main(){}
/*
//Write a text file - Version 2
//using System;
//using System.IO;
//using System.Text;
namespace readwriteapp
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
            Int64 x;
            try
            {
                //Open the File
                StreamWriter sw = new StreamWriter("d:\\config2.ini", true, Encoding.Unicode);
                //Writeout the numbers 1 to 10 on the same line.
                for(x=0; x < 10; x++)
                {
                    sw.Write(x);
                }
sw.Write("Ћирилица Караџића Вука");
                //close the file
                sw.Close();
            }
            catch(Exception e)
            {
                Console.WriteLine("ExceptionW: " + e.Message);
            }
            finally
            {
                Console.WriteLine("ExecutingW finally block.");
            }
            String line;
            try
            {
                //Pass the file path and file name to the StreamReader constructor
                StreamReader sr = new StreamReader("d:\\config2.ini");
                //Read the first line of text
                line = sr.ReadLine();
                //Continue to read until you reach end of file
                while (line != null)
                {
                    //write the lie to console window
                    Console.WriteLine(line);
                    //Read the next line
                    line = sr.ReadLine();
                }
                //close the file
                sr.Close();
                Console.ReadLine();
            }
            catch(Exception e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
            finally
            {
                Console.WriteLine("Executing finally block.");
            }
        }
    }
}
*/






Monday, August 24, 2020

INI file Read Write C#

 class INIFile
{
    private string filePath;
        
    [DllImport("kernel32")]
    private static extern long WritePrivateProfileString(string section,
    string key,
    string val,
    string filePath);
  
    [DllImport("kernel32")]
    private static extern int GetPrivateProfileString(string section,
    string key,
    string def,
    StringBuilder retVal,
    int size,
    string filePath);
        
    public INIFile(string filePath)
    {
        this.filePath = filePath;
    }
  
    public void Write(string section, string key, string value)
    {
        WritePrivateProfileString(section, key, value.ToLower(), this.filePath);
    }
  
    public string Read(string section, string key)
    {
        StringBuilder SB = new StringBuilder(255);
        int i = GetPrivateProfileString(section, key, "", SB, 255, this.filePath);
        return SB.ToString();
    }
          
    public string FilePath
    {
        get { return this.filePath; }
        set { this.filePath = value; }
    }
}

INIFile inif = new INIFile("D:\\config.ini");
inif.Write("Database", "Devs", "sa");
INIFile inif = new INIFile("D:\\config.ini");
Console.WriteLine("The Value is:" +inif.Read("Database", "Devs"));


//https://midnightprogrammer.net/post/readwrite-settings-to-ini-file-using-c/


Change INI File:

Easy way is to use WritePrivateProfileString and GetPrivateProfileString functions

of Kernel32.dll for reading and writing into INI file. Example: For Writing to INI: [DllImport("kernel32.dll", EntryPoint = "WritePrivateProfileString")] public static extern long WriteValueA(string strSection, string strKeyName, string strValue, string strFilePath); Usage: WriteValueA("SectionToWrite", "KeyToWrite", "Value", @"D:\INIFile.ini"); For Reading from INI: [DllImport("kernel32.dll", EntryPoint = "GetPrivateProfileString")] public static extern int GetKeyValueA(string strSection, string strKeyName, string strEmpty, StringBuilder RetVal, int nSize, string strFilePath); Usage: StringBuilder temp = new StringBuilder(255); int i = GetKeyValueA("TargetSection", "KeyToRead", string.Empty, temp, 255, @"D:\INIFile.ini"); string sValue = temp.ToString(); //desired value of the key

CMD:

systeminfo

driverquery

tasklist

ipconfig /all

color a

color b

cls



Friday, August 21, 2020

Inventions

 http://www.newneurophone.info/

https://hub.docker.com/_/wordpress

https://www.instructables.com/id/The-Ultimate-FM-Transmitter/

Super e-mail application, super office apps


Prisustvo na otisak prsta, a evidencija u bazi podataka:

++

++




MORE TIPS:


https://www.kaspersky.com/enterprise-security/mitre-attack

https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

https://www.softperfect.com/products/networkscanner/

https://youtu.be/bGqbdErUcWA

https://www.instructables.com/id/PCB-making-guide/

https://www.instructables.com/id/Heatless-cold-Toner-Transfer-for-PCB-Making/

e:

How to create your first VPS on DigitalOcean: A complete guide from zero to having a DigitalOcean VPS

The `cd` Linux command used to change folder

The `mkdir` Linux command used to create folders

How to test for an empty object in JavaScript

How to set up hot reload on Electron a

How to change a Next.js app port: Learn how to change the port that Next.js runs on in development mode

How to get the index of an item in a JavaScript array: Here is how to retrieve the index of an item in a JS array based on its value

That's it for this week, thank you for tuning in!

Don't forget that as a subscriber to my newsletter you have free access to the 12 books I published about React, Node, JS, Next, Svelte, and much more!

Let me know by replying to this email if there's a topic you'd like to read more about.

See you next Tuesday, have a great week ahead!

Flavio