# first term
tinyproxy -d
# second term
ssh -R 8888:127.0.0.1:8888 <ssh host>
# after connect
# proxy env var
export HTTP_PROXY=http://127.0.0.1:8888
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://docs.datadoghq.com/database_monitoring/setup_sql_server/gcsql/?tab=linuxhost&site=eu | |
DECLARE @databaseName NVARCHAR(255) | |
DECLARE @sql NVARCHAR(MAX) | |
DECLARE db_cursor CURSOR FOR | |
SELECT name | |
FROM sys.databases | |
WHERE state_desc = 'ONLINE' | |
AND name NOT IN ('master', 'tempdb', 'model', 'msdb') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <inttypes.h> | |
int isInteger(double input) { | |
uint64_t x = *((uint64_t*)&input); | |
if ((x & 0x7fffffffffffffffULL) == 0) | |
return 1; | |
int i; | |
for (i = 52; i >= 0 && !(x & (1ULL << (52-i))); i--); | |
return (int)(((x & 0x7ff0000000000000ULL) >> 52) - 1023) >= i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <dirent.h> | |
#include <sys/syscall.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# use as: ./docker_xfs_quota.sh <container id> | |
# requires xfsprogs, jq, docker | |
DIFF_DIR_PATH="$(docker inspect $1 | jq -r '.[0].GraphDriver.Data.UpperDir')" | |
PQUOTA_PROJECT_ID="$(xfs_io -c lsproj $DIFF_DIR_PATH | sed 's/projid = //')" | |
xfs_quota -x -c "quota -h -p ${PQUOTA_PROJECT_ID}" /var/lib/docker/ | |