Skip to content

Instantly share code, notes, and snippets.

View carlosmn's full-sized avatar
💭
Buried under a heap of yaks under a stack of todos

Carlos Martín Nieto carlosmn

💭
Buried under a heap of yaks under a stack of todos
View GitHub Profile
Stack overflow in unmanaged: IP: 0x7f7b0a88e33c, fault addr: 0x7f7afbc07f88
Stack overflow: IP: 0x7f7b0a88e33c, fault addr: 0x7f7afbbfef98
Stacktrace:
at <unknown> <0xffffffff>
at System.Net.Dns.GetHostByName (string) [0x0001d] in <a9a08e39ba304bd0a84c49bd158dfc02>:0
<...>
at System.Net.Dns.GetHostEntry (string) [0x00062] in <a9a08e39ba304bd0a84c49bd158dfc02>:0
at System.Net.Dns.GetHostAddresses (string) [0x00066] in <a9a08e39ba304bd0a84c49bd158dfc02>:0
at System.Net.Sockets.TcpClient.Connect (string,int) [0x00064] in <a9a08e39ba304bd0a84c49bd158dfc02>:0
at Meebey.SmartIrc4net.IrcConnection.Connect (string[],int) [0x001ac] in /home/carlos/smuxi/lib/SmartIrc4net/src/IrcConnection/IrcConnection.cs:616
source 'https://rubygems.org'
gem "sd_notify"
// Perform snapshot of domain console
func DomainVNCSnapshot(w http.ResponseWriter, r *http.Request) {
ruuid := chi.URLParam(r, "uuid")
errstr := "Failure retrieving VM details"
domobj, err := GetDomObj(ruuid)
if err != nil {
http.Error(w, errstr, http.StatusInternalServerError)
return
}
defer domobj.Free()
@carlosmn
carlosmn / anfile.md
Created September 12, 2017 07:44
An gist

An content

@carlosmn
carlosmn / rewrite-lg2s.sh
Last active October 29, 2017 08:58
An extremely case-specific implementation of git-filter-branch
#!/bin/bash
# It's no libgit2, but it's pretty useful
. $(git --exec-path)/git-sh-setup
cd_to_toplevel
require_clean_work_tree
set -e
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdarg.h>
int p_open(const char *path, int flags, ...)
{
mode_t mode = 0;
000000000045ad40 <p_open>:
45ad40: 48 81 ec c8 00 00 00 sub $0xc8,%rsp
45ad47: 49 89 d2 mov %rdx,%r10
45ad4a: 84 c0 test %al,%al
45ad4c: 74 31 je 45ad7f <p_open+0x3f>
45ad4e: 0f 29 44 24 30 movaps %xmm0,0x30(%rsp)
45ad53: 0f 29 4c 24 40 movaps %xmm1,0x40(%rsp)
45ad58: 0f 29 54 24 50 movaps %xmm2,0x50(%rsp)
45ad5d: 0f 29 5c 24 60 movaps %xmm3,0x60(%rsp)
45ad62: 0f 29 64 24 70 movaps %xmm4,0x70(%rsp)
@carlosmn
carlosmn / gist:9707518
Created March 22, 2014 13:56
Counting authors
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;
using LibGit2Sharp;
namespace list
{
class MainClass
{
% make
Making all in sources
make[1]: Entering directory `/home/carlos/apps/webkit-sharp/sources'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/carlos/apps/webkit-sharp/sources'
Making all in sources/glue
make[1]: Entering directory `/home/carlos/apps/webkit-sharp/sources/glue'
/bin/bash ../../libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"webkitgtk-sharp\" -DPACKAGE_TARNAME=\"webkitgtk-sharp\" -DPACKAGE_VERSION=\"1.10.2\" -DPACKAGE_STRING=\"webkitgtk-sharp\ 1.10.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"webkitgtk-sharp\" -DVERSION=\"1.10.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtk-3.0 -I/usr/include/libsoup-2.4 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/i
@carlosmn
carlosmn / Main.cs
Last active March 10, 2017 17:28
Gtk#-3 with GtkBuilder
using System;
using Gtk;
namespace builder
{
class MainWin
{
[Gtk.Builder.Object("window1")] Window window1;
public void OnToggled(object sender, EventArgs args)
{