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
# Sample haproxy postgresql master check | |
# | |
# haproxy listen: 5431 | |
# pg, instance #1 listen: 5432 (master node) | |
# pg, instance #2 listen: 5433 (replica node) | |
# external failover, promoting replica to master in case of failure | |
# passwordless auth for user web | |
# template1 database is accessible by user web | |
# | |
# haproxy will pass connection to postgresql master node: |
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 | |
# Author: ahmpro and community | |
# gist url: https://gist.github.com/ahmpro/f1fceddf1ac62d60980d | |
# Yandex dDNS(handmade Dynamic DNS) for OpenWrt | |
# Tested on OpenWrt Chaos Calmer r46612, LuCI (git-15.216.69575-bb7ea3e) | |
# You should install curl (don't forget update packages list) | |
# Get __TOKEN__: https://pddimp.yandex.ru/api2/admin/get_token |
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
--- | |
# usage: ansible-playbook -i '8.8.8.8,' bootstrap.yml | |
# oneline, for easy bootstrap, do not forget change ip and user :) | |
# wget https://gist.githubusercontent.com/ahmpro/57cca91f1a298b1adaa9/raw/bootstrap.yml -O /tmp/ahmpro_bootstrap.yml && ansible-playbook -i '8.8.8.8,' /tmp/ahmpro_bootstrap.yml -u root | |
- hosts: all | |
become: yes | |
become_user: root | |
handlers: | |
- name: restart ssh | |
service: name=sshd state=restarted |
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
<!DOCTYPE html> | |
<html><head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Хабрахабр / Профилактические работы</title> | |
<meta charset="utf-8"> | |
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport"> | |
<style> | |
@font-face { | |
font-family: 'PT Sans'; | |
font-style: normal; |
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
all: | |
gcc -Wall -lm -lpthread -std=gnu99 sobel.c -o sobel | |
clean: | |
rm sobel | |
rm edgemap_sobel.pgm | |
rm work.txt | |
rm table.txt | |
rm letsrock.pgm | |
check: | |
cppcheck --enable=all --inconclusive --std=posix sobel.c |
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
all: | |
gcc -Wall -std=gnu99 gamma.c -o gamma | |
gcc -Wall -std=gnu99 input.c -o input | |
gcc -Wall -std=gnu99 encoder.c -o encoder | |
clean: | |
rm gamma | |
rm input | |
rm encoder | |
rm gamma.txt | |
rm text.txt |
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
all: | |
gcc -Wall -std=gnu99 zhell.c -o zhell | |
clean: | |
rm zhell |
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
/* | |
* File: zupper.c | |
* Copyright 2014 L1S & ahmpro | |
*/ | |
#include <stdio.h> | |
#include <dirent.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
#include <sys/types.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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
#------------------------------------------------------------------------------- | |
# Short desc: Generator tests for chip (ИР11) | |
# Author: ahmpro | |
# Created: 18.04.2013 | |
#------------------------------------------------------------------------------- | |
class IR11: |
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
writeln "division_6.mcl running"; | |
REG RA[8], RB[8], R1[8], R2[8], R3[8], RC[8]; | |
REG SCH[8], TZ[1], SM[8]; | |
REG INPA[16], INPB[16]; | |
START: | |
write "A = "; read INPA; | |
write "B = "; read INPB; | |
TZ := INPA[15..15] XOR INPB[15..15]; |
NewerOlder