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
#!/opt/ruby/bin/ruby | |
require "socket" | |
require "pp" | |
gs = TCPServer.open(1500) | |
addr = gs.addr | |
addr.shift | |
printf("server is on %s\n", addr.join(":")) |
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 <ffi.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dlfcn.h> | |
int test_call_puts(void); | |
int invoke_puts(void *func); | |
int test_call_strcpy(void); | |
int invoke_strcpy(void *func); |
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
$ gdb cfunc_test -c core.7700 | |
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6) | |
Copyright (C) 2010 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-redhat-linux-gnu". | |
For bug reporting instructions, please see: | |
<http://www.gnu.org/software/gdb/bugs/>... |
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 "Mrb.h" | |
#include "mruby.h" | |
#include "mruby/proc.h" | |
#include "mruby/array.h" | |
#include "mruby/string.h" | |
#include "mruby/compile.h" | |
#include "mruby/dump.h" | |
using namespace Mrb; |
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
#!mruby | |
db = SQLite3::Database.new('example/foo.db') | |
begin | |
db.execute_batch( | |
'drop table foo;' + \ | |
'drop table bar;' \ | |
) | |
rescue RuntimeError |
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
$ valgrind --dsymutil=yes ../../../bin/mruby example/example.rb | |
==82019== Memcheck, a memory error detector | |
==82019== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. | |
==82019== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info | |
==82019== Command: ../../../bin/mruby example/example.rb | |
==82019== | |
==82019== WARNING: Support on MacOS 10.8 is experimental and mostly broken. | |
==82019== WARNING: Expect incorrect results, assertions and crashes. | |
==82019== WARNING: In particular, Memcheck on 32-bit programs will fail to | |
==82019== WARNING: detect any errors associated with heap-allocated data. |
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
C:\Users\foo>@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\choc | |
olatey\bin | |
Downloading http://chocolatey.org/api/v2/package/chocolatey/ to C:\Users\foo\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip | |
Extracting C:\Users\foo\AppData\Local\Temp\chocolatey\chocInstall\chocolatey.zip to ... | |
Installing chocolatey on this machine | |
Creating ChocolateyInstall as a User Environment variable and setting it to 'C:\Chocolatey' | |
We are setting up the Chocolatey repository for NuGet packages that should be at the machine level. Think executables/application packages, not library packages. | |
That is what Chocolatey NuGet goodness is for. | |
The repository is set up at 'C:\Chocolatey'. | |
The packages themselves go to 'C:\Chocolatey\lib' (i.e. C:\Chocolatey\lib\yourPackageName). |
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
#light | |
open System | |
open OpenQA.Selenium | |
open OpenQA.Selenium.Remote | |
// DesiredCapabilities.InternetExplorer | |
// let capability = DesiredCapabilities.Chrome() |
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/sh | |
# | |
# CentOS release 6.5 (Final) | |
# | |
sudo yum -y install readline-devel libyaml-devel openssl-devel | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc |
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
mgem add mruby-redis | |
mgem add mruby-curl | |
mgem config << __CONFIG__ | |
gcc | |
y | |
y | |
y | |
y | |
y |
OlderNewer