Skip to content

Instantly share code, notes, and snippets.

@RobinDavid
RobinDavid / cpuid.cpp
Created January 18, 2015 20:15
Retrieve MMX and SSE support using the CPUID assembly command.
#include <iostream>
using namespace std;
int main(int argc,char* argv[])
{
unsigned int cpeinfo;
unsigned int cpsse3;
__asm__(
"mov $01,%%eax;"
@stevenriggs
stevenriggs / base_package_code.vbs
Created March 22, 2015 01:13
Skeleton script to build a Windows application deployment for use with SCCM, Altiris, etc.
'base version:6
'DESCRIPTION OF TASKS
'AUTHOR
'DATE CREATED
'To run this silently:
'cscript.exe install_APPNAME.vbs /q
'Deal with command line arguments
Dim IsSilent
@rindeal
rindeal / cpuid-dump.c
Last active December 26, 2024 16:58
CPUID dumper
#if !defined(__GNUC__) || ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800)
# error "This program requires GNU C compiler v4.8+!"
#endif
#include <stdio.h>
#include <stdbool.h>
#define PRINT_TEST_CPU_SUPPORT_RESULT(inst) printf("\t%-7s: %d\n", inst, __builtin_cpu_supports(inst)?1:0)
#define PRINT_TEST_CPU_TYPE_RESULT(inst) printf("\t%-12s: %d\n", inst, __builtin_cpu_is(inst)?1:0)
@Earnestly
Earnestly / makepkg_overview.rst
Last active October 13, 2025 00:41
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

@jon-turney
jon-turney / building_xorg_with_mingw-w64.md
Last active March 13, 2023 18:45
Building X.Org for Windows using the MinGW-w64 toolchain

Building X.Org for Windows using the MinGW-w64 toolchain

This is almost possible with the upstream sources. These are notes about what the remaining difficulties we need to address.

While the majority of X.Org modules are portable to MinGW-w64, some aren't or don't make sense to port. (See [1] for a list)

@samhocevar
samhocevar / gist:00eec26d9e9988d080ac
Last active December 12, 2025 02:49
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@jdupl
jdupl / gist:b6fafb76d80c7b445f38
Created June 7, 2015 03:22
vz to lxc ct host to host migration
rsync -a --exclude=etc/inittab --exclude=etc/network/interfaces --exclude=dev/ --exclude=sys/ --exclude=proc/ "$VZ_CT_PATH" ssh "$HOST:/var/lib/lxc/$LXC_NAME/rootfs/"
@wrfly
wrfly / bash & nc chat
Last active August 24, 2023 17:35
A simple chat script
#!/bin/bash
# A little chat progream via ncat
# Author:wrfly Date:2015.7
# Usage:
# Server: ncat -e chat.sh -lk &
# Client: ncat server_ip
#config
db_users=user_lists
db_rooms=db_rooms
@izabera
izabera / asciinema-to-scriptreplay
Last active March 31, 2025 18:37
convert between asciinema and scriptreplay
#!/bin/bash
exec {times}> times {typescript}> typescript < "${1-/dev/stdin}"
while read -r; do [[ $REPLY = ' "stdout": [' ]] && break; done # skip to this line
LANG=C
printf "Script started on %(%c)T\n" -1 >&"$typescript" # dummy
while read -r open; [[ $open = '[' ]]; do
read -r elapsed; read -r string; read -r close
eval printf %b%n "$string" characters >&"$typescript" # put count in $characters
printf "%s %s\n" "${elapsed%,}" "$characters" >&"$times"
done
@fliedonion
fliedonion / !javascript in bat file.md
Last active December 13, 2025 14:23
How to Embed Javascript code in Windows Bat File.
Summary One example for embed javascript into windows bat file without any external tools or files.
Env windows node.js jscript