Skip to content

Instantly share code, notes, and snippets.

View chilyashev's full-sized avatar

Mihail Chilyashev chilyashev

View GitHub Profile
@chilyashev
chilyashev / gist:7215af24601f619f3ef6b1b2e6265951
Created September 28, 2023 06:29 — forked from Thermionix/gist:2715786
APC SC1000 UPS apcupsd usb serial adapter configuration
# use lsusb to find the details of the serial adapter to create a udev rule
~$ lsusb | grep Serial
Bus 003 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
# based on the output from lsusb add a rule to /etc/udev/rules.d/local.rules
~$ cat /etc/udev/rules.d/local.rules
#Bus 004 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port"
@chilyashev
chilyashev / zombies.md
Created May 16, 2018 19:51 — forked from defunkt/zombies.md
—All You Zombies— by Robert A. Heinlein

All You Zombies

2217 Time Zone V (EST) 7 Nov. 1970--NTC-- "Pop's Place": I was polishing a brandy snifter when the Unmarried Mother came in. I noted the time---10:17 P. M. zone five, or eastern time, November 7th, 1970. Temporal agents always notice time and date; we must.

The Unmarried Mother was a man twenty--five years old, no taller than I am, childish features and a touchy temper. I didn't like his looks---I never had---but he was a lad I was here to recruit, he was my boy. I gave him my best barkeep's smile.

Maybe I'm too critical. He wasn't swish; his nickname came from what he always said when some nosy type asked him his line: "I'm an unmarried mother." If he felt less than murderous he would add: "at four cents a word. I write confession stories."

If he felt nasty, he would wait for somebody to make something of it. He had a lethal style of infighting, like a female cop---reason I wanted him. Not the only one.

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@chilyashev
chilyashev / cloud_support.sh
Created November 22, 2013 22:02
My personal "Cloud infrastructure support"
#!/bin/bash
########################################################################################
# Watches the core temperature and if it's greater than 80 degrees, vmware gets killed #
########################################################################################
temperature=`sensors|grep -i 'core 0'|cut -d' ' -f9|sed s/'[\+|C|°]'//g`
if [ $EUID != 0 ]; then
echo "This fine piece of script must be run as root."
echo "And you, $USER, are certainly not root."
echo -e "\nSomething like \"sudo $0\" might work"
@chilyashev
chilyashev / dart.txt
Created November 15, 2013 20:53 — forked from paulmillr/dart.md
---------- Forwarded message ----------
From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
On November 10th and 11th, a number of Google teams representing a variety
of viewpoints on client-side languages met to agree on a common vision for
the future of Javascript.
@chilyashev
chilyashev / gist:6320056
Created August 23, 2013 14:39
define X in such way that (X+1 == X) is true :-)
#include <stdio.h>
#include <float.h>
#define X FLT_MAX
int main(){
if(X+1 == X){
printf("Yup.");
}else{
printf("Nope.");
}