Skip to main content

Posts

Showing posts from December, 2024

xdm linux merge incomplete download parts

 some download stuck at 99.99% , merge them regardless got to ~/.xdm-app-data/Data/*.state cat dec.py import os import re # Define the pattern to extract the segment number pattern = re.compile(r'seg-(\d+)-v1-a1\.ts') # Get the current working directory current_directory = os.getcwd() # List to hold tuples of (segment_number, filename) files_with_segments = [] # Iterate through files in the current directory for filename in os.listdir(current_directory): match = pattern.search(filename) if match: # Extract the segment number as an integer segment_number = int(match.group(1)) # Add the tuple (segment_number, filename) to the list files_with_segments.append((segment_number, filename)) # Sort the list by the segment number (numerical sort) files_with_segments.sort(key=lambda x: x[0]) # Open the filelist.txt for writing with open('filelist.txt', 'w') as filelist: for _, filename in files_with_segments: file...

winre install to partition

  winpe boot https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-install-on-a-hard-drive--flat-boot-or-non-ram?view=windows-11 download winpe https://www.osdcloud.com/sandbox/winpe-downloads extract sources 7zz x WinPE_Win11_22H2_WinRE_KB5026372.iso sources/boot.wim no windows/dism sudo apt install wimtools sudo mkfs.ntfs /dev/sda5 -Q wimlib-imagex info Downloads/sources/boot.wim WIM Information: Path: Downloads/sources/boot.wim GUID: 0x33ab2332b84c9243af5a1ed3f6351e00 Version: 68864 Image Count: 1 Compression: LZX Chunk Size: 32768 bytes Part Number: 1/1 Boot Index: 1 Size: 714629785 bytes Attributes: Relative path junction Available Images: Index: 1 Name: Microsoft Windows PE (x64) Description: Microsoft Windows Recover Environment (amd64) Directory Count: 6678 File Count: 24969 Total Bytes: 3627727209 Hard Link By...

how does windows boot

 Fallback bootloader most bios have fallback bootloader as  /EFI/BOOT/BOOTX64.EFI Windows Boot Manager \EFI\Microsoft\Boot\bootmgfw.efi   Boot Configuration Data \EFI\Microsoft\Boot\BCD Windows Boot Manager BCD identifier              {bootmgr} device                  partition=\Device\HarddiskVolume1 path                    \EFI\Microsoft\Boot\bootmgfw.efi description             Windows Boot Manager Bcdedit /set {bootmgr} device partition=s:     // system partition Get-WmiObject Win32_LogicalDisk bcdedit /store bcd-template /enum all Bcdedit /set {bootmgr} path \efi\microsoft\boot\bootmgfw.efi Bcdedit /set {fwbootmgr} displayorder {bootmgr} /addfirst ...

whats up video formats

  https://en.wikipedia.org/wiki/Comparison_of_video_container_formats container video format containers refer to the file that contained encoded audio and video , with metadata, subtitle , chapter etc MP4 (MPEG-4 Part 14) Patent encumbered Codecs: H.264, H.265 (HEVC), AAC MKV (Matroska Video) Freely licensed Codecs: H.264, H.265, VP9. AVI (Audio Video Interleave) Proprietary Codecs: DivX, Xvid, MPEG-4. no streaming MOV (Apple QuickTime Movie) Codecs: H.264, ProRes. FLV (Flash Video) Codecs: Sorenson Spark, VP6. WebM(google) Royalty-free Codecs: VP8, VP9, AV1. MPEG (Moving Picture Experts Group) MPEG-1, MPEG-2. MPEG-2 is considered outdated but its simplicity for modern hardware and widespread adoption in distribution standards make it difficult to phase out completely. However, its licensing fees and costs often lead device manufacturers to avoid supporting it when possible which is why many portable and embedded devices lack MPEG-2 compatibility. Interlaced Video Su...

bit about torrent

  btih https://en.wikipedia.org/wiki/Distributed_hash_table https://en.wikipedia.org/wiki/Mainline_DHT DHT (Distributed Hash Table) share files without the need for a central server DHT operates as a peer-to-peer network magnet:?xt=urn:btih:info_hash&dn=filename&tr=tracker_url xt stands for "exact topic," and it specifies the type of identifier. urn:btih: is a standard identifier for BitTorrent info hashes. info_hash is the unique SHA1 hash of the torrent’s metadata (file structure, file names, etc.), which is the key piece of information needed to find and identify the content. dn=filename (optional): dn stands for "display name." This field specifies the name of the file or content, which is useful for users to identify the torrent. ? separates the base URL from the parameters, and & separates multiple parameters

time sync with bash /dev/tcp

  cat </dev/tcp/time.nist.gov/13 60654 24-12-10 08:19:07 00 0 0 816.6 UTC(NIST) * nist time 13 : tcp/udp : Daytime Protocol (RFC 867): 37 : tcp : Time Protocol (RFC 868) 32 bit unix time 123 : udp : Network Time Protocol (NTP, RFC 5905) bash timescew.sh nist_response=$(cat </dev/tcp/time.nist.gov/13) nist_timestamp=$(echo $nist_response | awk '{print $2 " " $3}') nist_unix_time=$(date --date="$nist_timestamp UTC" +%s) system_time=$(date +%s) skew=$((system_time - nist_unix_time)) # Output the results echo "System time: $system_time (Unix timestamp)" echo "NIST time: $nist_unix_time (Unix timestamp)" echo "Time skew (offset): $skew ms" # we could get accuracy up to ms using %s%3N but network pings might be in ms to set time sudo date -s @unixtime view datefrom stamp date -d @timestamp

slackware try manual install

 http://slackware.uk/slackwarearm/slackwarearm-devtools/minirootfs/roots/ http://ftp.slackware.com/pub/slackware/slackware64-current/   http://slackware.uk/slackware/slackware64-current/    http://ftp.slackware.com/pub/slackware/slackware64-current/README.initrd  installpkg kernel-generic-6.9.7-x86_64-1.txz   installpkg kernel-modules-6.9.7-x86_64-1.txz   installpkg mkinitrd-1.4.11-x86_64-34.txz     cd /boot   mkinitrd -c -k 6.9.7 -m ext4     http://ftp.slackware.com/pub/slackware/slackware64-current/EFI/BOOT/     http://ftp.slackware.com/pub/slackware/slackware64-current/EFI/BOOT/huge.s     http://ftp.slackware.com/pub/slackware/slackware64-current/EFI/BOOT/initrd.img # installing minimal base from another linux get pkgtools mkdir pkg cd pkg http://slackware.uk/slackware/slackware64-current/slackware64/a/pkgtools-15.1-noarch-10.txz tar xf pkgtools-15.1-noarch-10.txz sudo cp -r var/lib/pk...

place value intl and hindu arabic

  [ https://simple.wikipedia.org/wiki/Names_of_large_numbers ] [ http://www.lekno.ws/A/bignumb.html ] Scientific Notation American Name (Short Form) Old European Name (Long Form) Old British Name SI Symbol Metric Prefix 1 One One One 10 Ten Ten Ten da Deca- 100 Hundred Hundred Hundred c Cent- 1,000 Thousand Thousand Thousand k Kilo- 10,000 Ten thousand Ten thousand Ten thousand 100,000 Hundred thousand Hundred thousand Hundred thousand 1,000,000 Million Million Million M Mega- 10^9 Billion Milliard Thousand million G Giga- 10^12 Trillion Billion Billion T Tera- 10^15 Quadrillion Billiard Thousand billion P Peta- 10^18 Quintillion Trillion Trillion E Exa- 10^21 Sextillion Trilliard Thousand trillion Z Zetta- 10^24 Septillion Quadrillion Quadrillion Y Yotta- 10^27 Octillion Quadrilliard Thousand quadrillion R Ronna- 10^30 Nonillion Quintillion Quintillion ...

mx repo on debian

  mx.list MX Community Main and Test Repos deb http://mxrepo.com/mx/repo/ bookworm main non-free #deb http://mxrepo.com/mx/testrepo/ bookworm test #deb http://mxrepo.com/mx/repo/ bookworm ahs debian.list Debian Stable Updates deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware Debian Stable deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware apt install mx-tools mx-apps mx-apps-fluxbox mx-apps-kde mx-apps-rpi mx-archive-keyring mx-boot-options mx-bootrepair mx-cleanup mx-codecs mx-comfort-themes mx-conky mx-conky-data mx-datetime mx-debian-firmware mx-debian-firmware-compat mx-desktop-menu-l10n mx-dockmaker mx-fluxbox mx-fluxbox-about mx-fluxbox-data mx-fluxbox-data-pi mx-goodies mx-gpg-keys mx-greybird-themes mx-icons-start mx-idesktool mx-idevice-mounter mx-installer mx-iphone mx-iso-templat...

linux mime

  https://github.com/sindresorhus/open/blob/main/xdg-open https://github.com/BachoSeven/mimi/blob/master/xdg-open gio mime mimetype gio info -a standard::content-type filename gio info -a standard::content-type fm uri: file:///home/k/.bin/fm local path: /home/k/.bin/fm unix mount: /dev/sda1 /home ext4 rw,noatime attributes: standard::content-type: application/x-shellscript file --mime-type -b fm text/x-shellscript cat ~/.config/mimi/mimi.conf TERM: foot MENU: wofi MENUARGS: --dmenu audio/: mpv --player-operation-mode=pseudo-gui video/: mpv --player-operation-mode=pseudo-gui video/: firefox image/: mvi pdf: zathura text/: $TERM $EDITOR text/html: firefox text/xml: firefox application/xhtml_xml: firefox x-scheme-handler/http: firefox x-scheme-handler/https: firefox x-scheme-handler/ftp: firefox x-scheme-handler/about = firefox x-scheme-handler/unknown = firefox

nix from linux

  normal install from iso https://nixos.org/manual/nixos/stable/index.html#sec-installation https://nixos.wiki/wiki/Installing_from_Linux https://nixos.org/manual/nixos/stable/#sec-installing-from-other-distro get nix sudo mkdir /nix sudo chown k /nix bash <(curl -L https://nixos.org/nix/install) nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation https://releases.nixos.org/?prefix=nix/ https://nix-community.github.io/nix-installers/ . /home/k/.nix-profile/etc/profile.d/nix.sh nix-channel --list nixpkgs https://nixos.org/channels/nixpkgs-unstable https://channels.nixos.org/ nix-channel --add https://nixos.org/channels/nixos- nixpkgs nix-channel --add https://channels.nixos.org/nixos-24.11 nixos nix-channel --update nix-channel --remove nixpkgs nix-env -f '' -iA nixos-install-tools make fs and mount target root to /mnt sudo which nixos-generate-config --root /mnt ls /mnt/etc/nixos con...

Human Ancestors

Human Ancestors: Time Periods of Origin and Extinction Sahelanthropus tchadensis      ~7–6 million years ago (mya)     ~6 mya      One of the earliest known hominins, possibly close to the last common ancestor of humans and chimpanzees. Orrorin tugenensis      ~6 mya     ~5.8 mya      Early bipedal hominin found in Kenya, with some adaptations for tree climbing. Ardipithecus kadabba      ~5.8–5.2 mya     ~5.2 mya      Early hominin with traits suggesting a mix of bipedalism and tree-dwelling. Ardipithecus ramidus      ~4.4 mya     ~4 mya      Adapted for both walking and arboreal life, with a grasping big toe. Australopithecus anamensis      ~4.2 mya     ~3.9 mya...
 https://download.freebsd.org/releases/amd64/14.1-RELEASE/   https://download.freebsd.org/releases/amd64/14.1-RELEASE/base.txz 198.3 MB https://download.freebsd.org/releases/amd64/14.1-RELEASE/kernel.txz 53.1 MB for 32 bit libs https://download.freebsd.org/releases/amd64/14.1-RELEASE/lib32.txz 60.5 MB for building from src:bsdports https://download.freebsd.org/releases/amd64/14.1-RELEASE/ports.txz 49.1 MB src: https://docs.freebsd.org/en/articles/remote-install/ # mdconfig -a -t vnode -u 10 -f FreeBSD-10.1-RELEASE-amd64-disc1.iso # mount_cd9660 /dev/md10 /cdrom mkdir DIST tar -xvf /cdrom/usr/freebsd-dist/base.txz -C DIST tar -xvf /cdrom/usr/freebsd-dist/kernel.txz -C DIST gpart create -s gpt /dev/ada0 gpart add -t freebsd-ufs -a 1M /dev/ada0 newfs /dev/ada0p1 gpart create -s gpt /dev/ada0 gpart add -t freebsd-zfs -a 1M /dev/ada0 zpool create zroot /dev/ada0p1

debian file list in pkgs

 apt list ?essential apt-cache show ~E | grep -Po '(?<=^Package: ).*' ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ dpkg debianutils init-system-helpers apt dash sysvinit-utils gzip bash util-linux tar base-files base-passwd sed bsdutils coreutils findutils grep login perl-base diffutils libc-bin libc-bin hostname ncurses-bin ncurses-base ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   dpkg   /etc/cron.daily/dpkg   /etc/alternatives/README /etc/dpkg/dpkg.cfg.d /etc/logrotate.d/alternatives /etc/logrotate.d/dpkg /lib/systemd/system/dpkg-db-backup.service /lib/systemd/system/dpkg-db-backup.timer   /sbin/start-stop-daemon /usr/bin/dpkg /usr/bin/dpkg-deb /usr/bin/dpkg-divert...

debian cis hardening script

  https://github.com/ovh/debian-cis download deb from release https://github.com/ovh/debian-cis/releases https://github.com/ovh/debian-cis/releases/download/latest/cis-hardening.deb sudo dpkg -i cis-hardening.deb patch is not installable sudo apt install -f default debian sudo /opt/cis-hardening/bin/hardening.sh --audit-all Total Available Checks : 243 Total Runned Checks : 243 Total Passed Checks : [ 130/243 ] Total Failed Checks : [ 113/243 ] Enabled Checks Percentage : 100.00 % Conformity Percentage : 53.49 % --set-hardening-level Modifies the configuration to enable/disable tests given an hardening level, between 1 to 5. Don't run this if you have already customized the scripts enable/disable configurations. 1: very basic policy, failure to pass tests at this level indicates severe misconfiguration of the machine that can have a huge security impact 2: basic policy, some good practice rules that, once applied, shouldn't break anything on most systems 3: best practice...

unlock bitclocker linux

  sudo cryptsetup open --type=bitlk /dev/DEVNAME MAPPERNAME sudo cryptsetup open --type=bitlk /dev/sda3 win sudo mount /dev/mapper/win mnt/win/ https://man.archlinux.org/man/core/cryptsetup/cryptsetup.8.en#BITLK_(WINDOWS_BITLOCKER_COMPATIBLE)_EXTENSION

linux binformat misc

 install qemu-user-static ./qemu-binfmt --register mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc fstab none  /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0 https://wiki.archlinux.org/title/Binfmt_misc_for_Java zig cc -o main main.c -target aarch64-linux-musl install cross-aarch64-linux-gnu-libc QEMU_LD_PREFIX=/usr/aarch64-linux-gnu ./main

beautifulsoup docs note

 https://beautiful-soup-4.readthedocs.io/en/latest/ pip install bs4 or beautifulsoup4 # parsers Python’s html.parser syn: BeautifulSoup(markup, "html.parser") adv: Batteries included, Decent speed, Lenient dis: Not as fast as lxml, less lenient than html5lib lxml’s HTML/Xml parser  :   https://lxml.de/    pip install lxml syn:  BeautifulSoup(markup, "lxml") , BeautifulSoup(markup, "lxml-xml") , BeautifulSoup(markup, "xml") [ only supported xml parser available ] adv:  Very fast, Lenient dis: External C dependency html5lib : https://github.com/html5lib/    pip install html5lib syn: BeautifulSoup(markup, "html5lib") adv: Extremely lenient, Parses pages the same way a web browser does, Creates valid HTML5 dis:  Very slow, External Python dependency 'html.parser' is default parser used if unspecified for now , better to specify for reliable future proof code how to parse BeautifulSoup = constructor method __init__() from bs4 i...

apt from src

 apt install dpkg-dev devscripts apt build-dep <package-name> debuild -b -uc -us -b: Build binary packages only -uc: Prevent signing of chainlog -us: Prevent signing of Source Code   dpkg-buildpackage -b -uc -us apt-get source --compile <package-name>    apt install zathura-dev libjbig2dec0-dev  libmupdf-dev libopenjp2-7-dev libssl-dev   https://debian-handbook.info/browse/stable/debian-packaging.html   https://git.pwmt.org/pwmt/zathura/-/issues/174  [libmupdf-dev] unable to link against libmupdf.a   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=617253        RFP: zathura-mupdf -- mupdf backend for zathura   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=833068      [mupdf] Please support to compile fitz as a .so   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719351      mupdf upstreams says "fitz is still immature and should not be exposed nor dynamicall...

debian alt in init : sysv,openrc,runit,systemd

  https://wiki.debian.org/Init http://www.yolinux.com/TUTORIALS/LinuxTutorialInitProcess.html chroot mode / init=/bin/sh apt --download-only install sysvinit-core libpam-elogind libelogind0 , libsystemd0 will pull systemd/elogind when necessary so you can swap one for other depending on need sysvinit-core has init in /sbin/init /usr/sbin/init is symlinked to /lib/systemd/systemd by systemd-sysv package also provides /usr/sbin/halt,init,poweroff,reboot,runlevel,shutdown,telinit dracut has /init as systemd init-system-helpers(essential) /usr/bin/deb-systemd-helper,deb-systemd-invoke /usr/sbin/invoke-rc.d,service,update-rc.d sudo apt install initscripts sysvinit-core /usr/sbin/halt,init,poweroff,reboot,runlevel,shutdown,telinit /usr/share/sysvinit/inittab sysvinit-utils(essential) /usr/bin/pidof /usr/lib/init/init-d-script /usr/lib/init/vars.sh /usr/lib/lsb/init-functions /usr/lib/lsb/init-functions.d/00-verbose /usr/sbin/fstab-decode /usr/sbin/killall5 reinstall udev without...