Skip to content

Instantly share code, notes, and snippets.

@sl0ki
sl0ki / docker-compose.yml
Created January 18, 2017 16:17
LRMP Docker stack
version: "2"
volumes:
web-data:
mysql-data:
services:
nginx:
image: nginx
restart: always
@sl0ki
sl0ki / api-doc
Last active December 22, 2016 15:35
API Doc
## Response structure
#### Success response example
```
{
"status": "success",
"data": [
{
"entity_id": "1",
"entity_type_id": "4",
"attribute_set_id": "4",
@sl0ki
sl0ki / 0_reuse_code.js
Created December 21, 2016 10:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sl0ki
sl0ki / vk_restore_message
Created March 18, 2016 14:17
how to restore deleted vk messages
// got to vk.im/ page
// copy paste this js to console and run
// profit
var lastMsgId = parseInt(geByClass('dialogs_row ')[0].className.match(/dialogs_msg(.*)/)[1]);
var lastMsgId = lastMsgId + 10;
for (var i = lastMsgId; i > lastMsgId - 100; i--) {
var id = i;
console.log('try restore message: ' + id);
ajax.post('al_mail.php', {act: 'a_restore', id: i, from: 'im', hash: cur.mark_hash, gid: cur.gid});
# main DNS server for containers
dns:
image: phensley/docker-dns
container_name: dns
restart: always
volumes:
- /var/run/docker.sock:/docker.sock
ports:
- "172.17.42.1:53:53/udp" # set dns port to docker bridge IP
# nginx main (bulild system 80,443 ports)
web:
image: nginx
container_name: nginx_main
volumes:
- /shared/nginx/config/:/etc/nginx/conf.d/
- /shared/nginx/static/:/usr/share/nginx/html/
- /shared/nginx/ssl/:/etc/nginx/ssl/
ports:
- "80:80"
- "443:443"
/* Sample UDP server */
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
int main(int argc, char**argv)
{
int sockfd,n;
struct sockaddr_in servaddr,cliaddr;
import fsevents
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 1024
MESSAGE = "Hello, World!"
host = 'localhost';
import fsevents
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 5005
BUFFER_SIZE = 1024
MESSAGE = "Hello, World!"
host = 'localhost';