Skip to content

Instantly share code, notes, and snippets.

@felipec
felipec / vte-client.c
Last active March 20, 2023 15:49
Test for vte buggy code
#include <vte/vte.h>
char *cmd = "(for i in $(seq 1 10); do echo $i; sleep 1; done) & exit";
static void run(VteTerminal *terminal)
{
char * const argv[] = { "/bin/bash", "-i", "-c", cmd, NULL };
vte_terminal_spawn_async(terminal,
0, NULL, (char **)argv, NULL, 0, NULL, NULL, NULL, -1, NULL, NULL, NULL);
}
@felipec
felipec / pty-test.c
Last active March 6, 2023 01:25
zsh pty test
#define _XOPEN_SOURCE 600
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/wait.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <string.h>
@felipec
felipec / PKGBUILD
Created February 25, 2023 00:13
vte3-notification
# Maintainer: Jason Edson <jaysonedson _AT_ gmail.com>
# Contributor: Davi da Silva Böger <dsboger _AT_ gmail.com>
# Contributor: Manuel Hüsers <manuel.huesers _AT_ uni-ol.de>
# Contributor: Fernando Fernandez <fernando _AT_ softwareperonista.com.ar>
# Contributor: Jan de Groot <jgc _AT_ archlinux.org>
pkgname=vte3-notification
pkgver=0.70.3
pkgrel=1
pkgdesc='Virtual Terminal Emulator widget (GTK3) (plus Fedora patches)'
#!/bin/bash
d=/tmp/git-test
git init -q -b master "$d"
cd "$d" || exit
for i in $(seq 1000); do
git commit -q -m commit --allow-empty
done
On Tue, Nov 17, 2009 at 2:06 PM, Nanako Shiraishi <nanako3@lavabit.com> wrote:
> Quoting Felipe Contreras <felipe.contreras@gmail.com>
>> Right, your explanation is more clear:
>
> You have a funny way of saying "I'm sorry, I wasn't constructive,
> and my attitude repelled many participants from the discussion".
That's because that's not what I said. If my succinct counter-argument
to a side-topic repelled some people from the much more serious
discussion, that's fine for me, because it means I'm not making myself
@felipec
felipec / git-reviewers
Last active June 19, 2021 21:12
git-reviewers
#!/usr/bin/env ruby
require 'notmuch'
$skip = <<EOF.split("\n")
xmqqsgg7u3js.fsf@gitster.c.googlers.com
CAPig+cRqvd=_n9huD_txEr6EXVrWZx0onReL5bh_mCKy3M3LOg@mail.gmail.com
xmqqy2g08o0r.fsf@gitster.c.googlers.com
20190930153741.GA6124@chatter.i7.local
53844AEF.1080502@alum.mit.edu
@felipec
felipec / git-top-trailers
Last active May 27, 2021 23:42
git-top-trailers
#!/usr/bin/env ruby
ROLES_REGEX = /^([^ \t\n\[\]\(\):]+): ([^<>]+) <(\S+?)>$/
$roles = Hash.new(0)
log_args = [ '--no-merges', '--format=%b%x00' ]
IO.popen(%w[git log] + log_args + ARGV) do |pipe|
pipe.each("\0\n", chomp: true) do |commit|
trailer = commit.scrub.split("\n\n").last
@felipec
felipec / parseopt.rb
Last active May 26, 2021 20:29
Simple option parser
# This is now a gem
# https://rubygems.org/gems/parseopt
class ParseOpt
class Option
attr_reader :short, :long, :help
def initialize(short, long, help, &block)
@block = block
@short = short
@felipec
felipec / aur-check
Last active May 5, 2021 08:08
Script to check AUR packages
#!/usr/bin/env ruby
# This script checks all your foreign packages against AUR to find newer versions
require 'net/http'
require 'json'
$packages = {}
$all = false
@felipec
felipec / autogroups
Last active November 22, 2020 04:02
Display a list of all the processes listed by their autogroup (CONFIG_SCHED_AUTOGROUP)
#!/usr/bin/env ruby
$autogroups = Hash.new { |h,k| h[k] = [] }
Dir.glob('/proc/*').each do |e|
pid = File.basename(e).to_i
next if pid == 0
begin
cmdline = File.read(e + '/cmdline').split("\0").join(" ")
next if cmdline.empty?