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
| #include <iostream> | |
| using namespace std; | |
| int main(int argc,char* argv[]) | |
| { | |
| unsigned int cpeinfo; | |
| unsigned int cpsse3; | |
| __asm__( | |
| "mov $01,%%eax;" |
| '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 |
| #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) |
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)
| #!/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 | |
| # |
| 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/" |
| #!/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 |
| #!/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 |
| Summary | One example for embed javascript into windows bat file without any external tools or files. |
| Env | windows node.js jscript |