Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
@Zhomart
Zhomart / tictactoe.cpp
Created March 6, 2014 23:04
assignment 2
#include <iostream>
#include <cstdio>
#include <fstream>
using namespace std;
#define INVALID "i"
#define WIN_X "x"
#define WIN_O "o"
#define TIE "t"

From my computer:

$ ssh -t dokku@example.com run my-app ls
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ case "$1" in
++ ls -d /var/lib/dokku/plugins/00_dokku-standard/commands /var/lib/dokku/plugins/backup/commands /var/lib/dokku/plugins/config/commands /var/lib/dokku/plugins/git/commands /var/lib/dokku/plugins/nginx-vhosts/commands
+ for script in '$(ls -d /var/lib/dokku/plugins/*/commands)'
+ /var/lib/dokku/plugins/00_dokku-standard/commands run my-app ls
+ case "$1" in

In the server

user@the-pc:~/dokku$ sudo docker ps -a
CONTAINER ID        IMAGE                         COMMAND                CREATED              STATUS              PORTS                     NAMES
cc3bccf5b095        app/my-app:latest   /exec ls               About a minute ago   Exit 1                                        grave_curie
874c309f2f0e        app/my-app:latest   /exec ls               3 minutes ago        Exit 1                                        high_bardeen
6b02eae74800        app/my-app:latest   /exec ls               8 minutes ago        Exit 1                                        romantic_turing
e232456a74b5        app/my-app:latest   /exec ls               56 minutes ago       Exit 1                                        trusting_darwin1
39673439298c        app/my-app:latest   /exec ls -la           About an hour ago    Exit 1                                        goofy_bohr
/* Implement the three functions specified. When implemented properly,
the output of this program is
5 3 1 -4 2
4
0
-1
3 1 2 -2 -1 0
-2 -1
3 5 1 2 -2 -1 7 8 0 9
*/
/*
The Wheel Game
--------------
- There are three contestants: A, B, C. A plays first, then B, then C.
- Each contestant's score is determined by the sum of three spins of a wheel.
- Each spin is a number from 5 to 100, intervals of 5, ie. 5, 10, 15, 20, ... , 95, 100
{
"HOSTNAME"=>"ee62e5e58142",
"WAT"=>"YAY",
"LANG"=>"en_US.UTF-8",
"SHLVL"=>"3",
"HOME"=>"/app",
"RAILS_ENV"=>"production",
"RACK_ENV"=>"production",
"PATH"=>"/app/vendor/bundle/ruby/2.0.0/bin:/app/bin:/app/vendor/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GEM_PATH"=>"",
@Zhomart
Zhomart / gist:11276452
Created April 25, 2014 02:54
mpd building error with gcc-4.9
$ brew reinstall -v mpd --cc=gcc-4.9 2>&1
==> Reinstalling mpd with --with-yajl, --with-lastfm
rm /usr/local/bin/mpd
rm /usr/local/share/man/man5/mpd.conf.5
rm /usr/local/share/man/man1/mpd.1
rm /usr/local/share/doc/mpd
==> Downloading http://www.musicpd.org/download/mpd/0.18/mpd-0.18.9.tar.xz
Already downloaded: /Library/Caches/Homebrew/mpd-0.18.9.tar.xz
==> Verifying mpd-0.18.9.tar.xz checksum
@Zhomart
Zhomart / gist:11277557
Created April 25, 2014 04:18
brew --config
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: b06306181f9ce958e04a7c5697ddbfb11a14c750
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
@Zhomart
Zhomart / gist:11277585
Created April 25, 2014 04:20
brew doctor
$ brew doctor
Warning: gettext files detected at a system prefix
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
/usr/local/include/libintl.h
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
@Zhomart
Zhomart / gist:11277613
Created April 25, 2014 04:22
mpd/02.make
$ cat ~/Library/Logs/Homebrew/mpd/02.make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
g++-4.9 -DHAVE_CONFIG_H -I. -DNDEBUG -I./src -D_REENTRANT -isystem /usr/local/Cellar/glib/2.40.0/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.40.0/lib/glib-2.0/include -isystem /usr/local/opt/gettext/include -DSYSTEM_CONFIG_FILE_LOCATION='"/usr/local/Cellar/mpd/0.18.9/etc/mpd.conf"' -I/usr/local/Cellar/fluid-synth/1.1.6/include -I/usr/local/Cellar/ffmpeg/2.2.1/include -std=gnu++0x -g -O2 -fvisibility=hidden -fno-threadsafe-statics -fmerge-all-constants -fno-exceptions -fno-rtti -ffast-math -ftree-vectorize -ffunction-sections -fdata-sections -Wall -Wextra -Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings -Wsign-compare -c -o src/libdecoder_plugins_a-DecoderBuffer.o `test -f 'src/DecoderBuffer.cxx' || echo './'`src/DecoderBuffer.cxx
g++-4.9 -DHAVE_CONFIG_H -I. -DNDEBUG -I./src -D_REENTRANT -isystem /usr/local/Cellar/glib/2.40.0/include/glib-2.0 -isystem