Skip to content

Instantly share code, notes, and snippets.

@novaTopFlex
novaTopFlex / FileTypes.md
Created May 22, 2024 00:37
File Types from Linux `file` command

Output from gcc -m32 -o [Program] [Program].c && file Program:

Program: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=4dbc54aee00e05742077f05b5be11583c55197a3, for GNU/Linux 3.2.0, not stripped

Output from gcc -mx32 -o [Program] [Program].c && file Program:

Program: ELF 32-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=f76b7461fbd56cb195d4e4fc345a33b554514043, for GNU/Linux 3.4.0, not stripped

Output from gcc -m64 -o [Program] [Program].c && file Program:

@novaTopFlex
novaTopFlex / Incomplete.py
Created April 30, 2024 12:16
This is an incomplete Python script of only the modules that I am likely to import in my Python projects and nothing else.
import os # Interface with the operating system
import sys # Interface with system information
import tkinter # Interface with Tcl/Tk; default graphical toolkit for Python
import tkinter.ttk # Extended interface for Tcl/Tk
import tkinter.colorchooser # Add colorchooser compatibility to Tkinter.
import tkinter.commondialog # Add support for dialog types to Tkinter.
import tkinter.constants # Implementation of various constants from Tkinter
import tkinter.dnd # Create drag-and-drop support with Tkinter.
import tkinter.filedialog # Create file dialogs with Tkinter.
import tkinter.messagebox # Create graphical message boxes (technically dialog boxes) for Tkinter.
@novaTopFlex
novaTopFlex / EOL.md
Created April 26, 2024 23:35
The "EOL" concept in open-source

Introduction

Unlike proprietary software, open-source software allows for the ability to view source code for various applications. As such, we do not believe that the "end-of-life" concept should necessarily apply to open-source. In theory, one could have forked an archived version of software and re-compiled such software to enable operations on more modern systems without problem depending on the specific piece of software to be updated.

Open-Source Benefits with EOL

novaTopFlex believes that the concept of "end-of-life" is uniquely the result of support ending in proprietary software, thus not creating impacts to the open-source community. In the open-source community, forks of legacy software could theoretically be modernized without issue, thus enabling for support with later systems, whether the former/legacy interface is preferred over the modernized or otherwise.

@novaTopFlex
novaTopFlex / ClearPython.md
Created April 25, 2024 18:37
Clear the Screen in a Python Interpreter

Clearing the Interpreter

There are multiple solutions to clearing the Python interpreter.

With os

With the os module, the code is as follows:

import os
os.system("clear")

The os.system() function will perform the applicable shell command with the default interpreter, often as /bin/sh.

With clear

To install the clear module:

@novaTopFlex
novaTopFlex / PythonGUI.md
Last active April 25, 2024 17:56
Graphical User Interface (GUI) Modules for Python

Recommended Modules

Tkinter (default module)

Name of module in Python 2.x:

Tkinter

Name of module in Python 3.x:

tkinter

Description

The "standard" graphical user interface "GUI" library for the Python programming language and various interpretations. Compatible with nearly all Python 2.x and 3.x interpreters, this Python module should operate successfully on Windows (NT-based) and UNIX-based systems, including Apple macOS as well as the various open-source distributions of Linux/BSD/Solaris that are also based on UNIX.

wxPython

Name of module in Python 3.x:

@novaTopFlex
novaTopFlex / PyStyles.md
Last active April 25, 2024 12:21
General and Technical Color Schemes for Python Projects

Technical Styles

  • 0 - Elements not colorized.
  • 1 - #ff0000
  • 2 - #ffff00
  • 3 - #00ff00
  • 4 - #00ffff
  • 5 - #0000ff
  • 6 - #ff00ff
  • 7 - #ffffff (and/or #000000) With technical styles 1 through 6, every colorized element could blend in, or "camouflage" into the same color; or such elements could be colorized differently as #000000 and/or #ffffff instead. With style 7, all elements are #000000 or #ffffff by default.
@novaTopFlex
novaTopFlex / PyModules.md
Last active April 19, 2024 18:25
Python Modules in novaTopFlex Projects

Introduction

novaTopFlex believes that modules are absolutely necessary in the vast majority of repositories, including under the future nomenclature system for names of products and projects.

Common Modules in novaTopFlex Repositories (Python)

  • os for system interaction and related purposes/tasks
  • sys for system information and monitoring
  • tkinter for basic graphical computing
  • wx for wxPython (advanced graphical interfacing)
  • tensorflow for TensorFlow artificial intelligence

Recommended Installation Procedures for wxPython and TensorFlow

  • wxPython: pip install wxPython
@novaTopFlex
novaTopFlex / Programming.md
Last active April 18, 2024 18:46
Programming Standards Set by the novaTopFlex Philosophy

Introduction

Programming languages often require modules for full operation, yet many of the necessary modules have not been implemented by default. When programmers refer to "batteries" they often refer to the inclusion of a diverse range of modules in default installations of various programming languages, yet many more modules may remain undiscovered in default installations.

Philosophy

Modules Required

In various programming languages, useful information is best provided through the implementation of modules. With modules, one may not necessary be forced to write code that may be impossible to write without the applicable modules. For instance, on a default Python interpreter, one may not access the file system until the os module is imported. A large portion of system information remains undiscovered until the sys module is imported. And for graphical design, modules like tkinter or wxPython are often necessary with the Python interpreters.

Modules Not Available

Depending on the program

@novaTopFlex
novaTopFlex / VNCSetup.md
Last active April 10, 2024 00:33
novaTopFlex VNC Setup

VNC Setup

VNC Ports

$ tigervncserver -geometry 2048x1152 :1 -xstartup ~/VNC/jstartuprc # by Joe Wing  
$ tigervncserver -geometry 2048x1152 :2 -xstartup ~/VNC/jstartuprc  
$ tigervncserver -geometry 2048x1152 :3 -xstartup ~/VNC/jstartuprc  
$ tigervncserver -geometry 2048x1152 :4 -xstartup ~/VNC/jstartuprc
$ tigervncserver -geometry 4096x2304 :5 -xstartup ~/VNC/obstartuprc # by the Openbox Project

VNC Applications

$ DISPLAY=:0 xsetroot -solid RoyalBlue # Native Display

$ DISPLAY=:1 xsetroot -solid LightSlateBlue

@novaTopFlex
novaTopFlex / Extensions.md
Last active April 5, 2024 13:22
Common and Special File Extensions
  • c for C
  • cpp for C++ (Alternate is c++)
  • h for C and C++ headers
  • sh for Shell scripts (#! for the shebang)
  • py for Python scripts (Context should separate Python 3 scripts from legacy Python 2.)
  • rb for Ruby scripts
  • pl for Perl (Perl5) scripts
  • raku for Raku (formerly Perl6) scripts
  • rakumod for Raku modules
  • rakudoc for Raku documentation in the POD6 format