Skip to content

Instantly share code, notes, and snippets.

@diyism
diyism / software alternative for linux.md
Last active July 3, 2024 02:20
software alternative for linux,migrating from windows to linux
  1. DOS usb boot -> ubuntu live iso usb boot(too big), minimal_linux_live_20-Jan-2017_64-bit.iso(only 6.8MB)
  2. diskgenius for dos -> testdisk("No Log\Proceed\Intel\Analyse\Quick Search", better than fdisk), gnome-disks
  3. norton ghost for dos -> "fsarchiver savefs" "fsarchiver restfs", remastersys
  4. windows xp -> debian+de(lxde, xfce), kali, ubuntu
  5. ntldr boot.ini -> grub menu.lst, boot-repair
  6. RemapKey/KeyTweak -> xmodmap -pke > ~/.Xmodmap then modify it, it will be loaded automatically
  7. myboard.exe -> myboard.py + modified xorg-server + modified libgtk2.0-0 + fcitx-googlepinyin
  8. MagicMover(D:\Program Files) -> remastersys restored sda1 + UnionFS-FUSE(pivot_root) sda2
  9. WinHex -> wxHexEditor, bless, (sublime hexviewer only can edit one line)
  10. emEditor(PHP/C braces outline, csv editor) -> sublime(ctrl+r to list functions, addon packages: AlignTab,SublimeCodeIntel,Codecs,ConvertToUTF8), SciTE(to view log files)
@mrkline
mrkline / c_sharp_for_python.md
Last active June 23, 2024 14:46
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@iamnewton
iamnewton / bash-colors.md
Last active July 10, 2024 19:49
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@beatcracker
beatcracker / Invoke-RawPipeline.ps1
Last active March 28, 2022 21:58
Pipe binary data between processes' Standard Output and Standard Ipput streams. Can read input stream from file and save resulting output stream to file.
<#
.Synopsis
Pipe binary data between processes' Standard Output and Standard Input streams.
Can read input stream from file and save resulting output stream to file.
.Description
Pipe binary data between processes' Standard Output and Standard Input streams.
Can read input stream from file/pipeline and save resulting output stream to file.
Requires PsAsync module: http://psasync.codeplex.com
@MightyPork
MightyPork / usb_hid_keys.h
Last active July 16, 2024 15:47
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@palopezv
palopezv / dwm_config_pulseaudio.h
Last active June 19, 2024 15:52 — forked from neuro-sys/dwmconfig.h
dwm volume control with hardware multimedia keys (pipewire, pulseaudio, amixer and light as an extra)
/**
* dwmconfig.h
* Hardware multimedia keys
*/
/* Somewhere at the beginning of config.h include: */
/*
You obviously need the X11 development packages installed, X11proto in particular, but
here is the location of the keysyms header upstream copy if you can't bother
using the contents of your own hard drive. ;-P
@rickyzhang82
rickyzhang82 / keycode.linux
Created September 15, 2017 22:11
Key code for Linux
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>
@orhun
orhun / arch_linux_installation.md
Last active July 3, 2024 21:17
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)
@mal1kc
mal1kc / system_hardware_info.py
Last active July 11, 2022 15:24
system hardware info with python3 ;psutil module and builtin platform,datetime modules
import psutil
import platform
from datetime import datetime
def get_size(bytes, suffix="B"):
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
@jdah
jdah / macro_explanation.c
Created January 31, 2024 14:21
explaining some C macro magic
// so a cool trick with macros in C (and C++) is that since macros inside of
// macros are stille evaluated by the preprocessor, you can use macro names as
// parameters to other macros (and even construct macro names out of out of
// parameters!) - so using this trick if we have some macro like
// this:
#include <stddef.h>
#define MY_TYPES_ITER(_F, ...) \
_F(FOO, foo, 0, __VA_ARGS__) \