Skip to content

Instantly share code, notes, and snippets.

View samuell's full-sized avatar
💻
Hacking away

Samuel Lampa samuell

💻
Hacking away
View GitHub Profile
$ tmux list-sessions
no server running on /tmp/tmux-1000/default
$ tmux new-session -d -s TmuxTestSession
$ tmux list-sessions
0: 1 windows (created Wed Nov 9 13:49:04 2016) [80x23]
TmuxTestSession: 1 windows (created Wed Nov 9 13:49:04 2016) [239x66]
[vagrant w]$ composer install -vvv
Reading ./composer.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): hg branch
Executing command (CWD): svn info --xml
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading plugin Wikimedia\Composer\MergePlugin
curl -X GET https://query.wikidata.org/sparql \
--data-urlencode "format=json&query='CONSTRUCT ?s <http://example.org/onto/dummypred> ?o WHERE { ?s ?p ?o } LIMIT 100'" -H 'Accept:text/plain' \
> data/testquery.nt
#!/bin/bash
curl -X GET https://query.wikidata.org/sparql \
--data-urlencode "format=json&query='CONSTRUCT ?s <http://example.org/onto/dummypred> ?o WHERE { ?s ?p ?o } LIMIT 100'" -H 'Accept:text/plain' \
> data/testquery.nt
package main
import (
"bytes"
"fmt"
"os/exec"
"sync"
)
func main() {
package main
import (
"fmt"
"math"
"runtime"
"strings"
)
const (
#!/usr/bin/env python3.5
# Adapted from J.F. Sebastian's answer at http://stackoverflow.com/a/34027086/340811
import asyncio
import sys
from asyncio.subprocess import PIPE, STDOUT
async def get_lines(shell_command):
p = await asyncio.create_subprocess_shell(shell_command, stdin=PIPE, stdout=PIPE, stderr=STDOUT)
return (await p.communicate())[0].splitlines()
package main
import (
"bytes"
"fmt"
"os/exec"
"sync"
)
func main() {
defmodule Exmultiproc do
for _ <- 1..500 do
cmd = "sleep 3600"
IO.puts "Starting another process ..."
Port.open({:spawn, cmd}, [:exit_status, :stderr_to_stdout])
end
System.cmd("sleep", ["3600"])
end
package main
import (
"fmt"
"os/exec"
"sync"
)
func main() {
wg := new(sync.WaitGroup)