Start off with some Rust source code
hw.rs :
#[link(name = "extern")]
extern {
fn hello();
}
$ python i18njson-translate.py --help | |
Usage: i18njson-translate.py [OPTIONS] INPUTFILE OUTPUT | |
Process and translate .po or JSON files and generate translated .po file | |
in result. Can work with exist .po files and if in initial file msgid | |
dissapear then mark translaed string as obsolete. Try to play nice with | |
version control systems and follow initial file order format, you will get | |
predicteable diffs. | |
Options: |
#!/bin/bash | |
merge_commit() { | |
git show --no-patch --format='%P' "$@" | head -1 | grep -q ' ' | |
} | |
commit_meta() { | |
git show --no-patch --format="* %cd %aN <%ae> - %H" --date=local "$@" | \ | |
head -1 | \ | |
sed -E 's/^(\* [a-z0-9 ]{9,10}) \d{2}:\d{2}:\d{2}/\1/i' |
#!/bin/bash | |
############################################################################## | |
# Wrapper for non-interactive signing of RPMs. | |
# | |
# _NOTE: This uses environment variables for sensitive information (the GPG | |
# passphrase), so should not be used on an untrusted or shared host._ | |
# | |
# Prep | |
# ---- |
# Linux kernel verbose boot and logging to serial console | |
# | |
# Check Documentation/kernel-parameters.txt [1] to check all aplicable options for your kernel version | |
# | |
# VERSION="v"$(uname -r | sed -e 's/\(\.0\)\?-.*$//') | |
# [1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/plain/Documentation/kernel-parameters.txt?id=refs/tags/$VERSION | |
linux /vmlinuz root=/dev/sda1 ro consoleblank=0 earlyprintk=ttyS0 console=ttyS0 panic=1 oops=panic panic_on_warn verbose INIT_VERBOSE=yes init=/sbin/init -v | |
initrd /initrd.gz | |
boot |
# This script create a Centos Minimal Unattended ISO | |
# This method is based on excellent article http://pyxlmap.net/technology/software/linux/custom-centos-iso | |
# | |
# This script has be tested with CentOS 6.5 | |
# TODO: | |
# * test package update to reduce the update task on the target system. The following command downloads all updates : | |
# (cd $CENTOS_CUSTOM_PATH/Packages ; yumdownloader $(for i in *; { echo ${i%%-[0-9]*}; } ) ) | |
# Some global settings : |
Start off with some Rust source code
hw.rs :
#[link(name = "extern")]
extern {
fn hello();
}
I started getting the error below after upgrading to gpg (GnuPG) 2.1.21 . | |
gpg: signing failed: Timeout | |
gpg: signing failed: Timeout | |
This was confusing at first, but the timeout was caused by gpg showing a password prompt that takes the full screen of the terminal, and after a period of time, it returned to the command line showing the timeout error. | |
I didn't notice the password prompt at first because I was working on multiple terminals and only saw the timeout error at the end. | |
Another error that I encountered earlier was: |
#!/bin/sh | |
RELAY="$1" | |
PORT="$2" | |
echo -n 'nat-hole-punch' | socat STDIN "UDP-SENDTO:$RELAY:$PORT,sourceport=$PORT" | |
mosh-server new -p "$PORT" | sed -n 's/MOSH CONNECT [0-9]\+ \(.*\)$/\1/g p' |
apt install -y vim | |
apt install -y wget | |
apt install -y sqlite3 (used by a test, not needed for the build to complete) | |
apt install -y curl | |
apt install -y git | |
apt install -y build-essential | |
apt install -y pkg-config |
// LZ4 streaming API example 2 (ring buffer) | |
#define _CRT_SECURE_NO_WARNINGS // for MSVC | |
#include "lz4.h" | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> |