Skip to content

Instantly share code, notes, and snippets.

View Amar1729's full-sized avatar

Amar Paul Amar1729

View GitHub Profile
@Amar1729
Amar1729 / libguestfs-gnulib.patch
Last active December 19, 2022 02:38 — forked from zchee/libguestfs-gnulib.patch
PATCH: libguestfs gnulib
diff --git a/configure b/configure
index 65f1145..068f21f 100755
--- a/configure
+++ b/configure
@@ -24432,9 +24432,9 @@ if ${gl_cv_func_getcwd_abort_bug+:} false; then :
$as_echo_n "(cached) " >&6
else
# Remove any remnants of a previous test.
- rm -rf confdir-14B---
+ # rm -rf confdir-14B---
@Amar1729
Amar1729 / main.py
Created January 26, 2021 02:56
use telethon to send a bunch of messages (replies to polls) to a telegram chat
#! /usr/bin/env python3
import datetime
import json
from telethon.sync import TelegramClient
from telethon.tl.types import InputPeerChat, MessageMediaPoll
# expects a settings.py in the same directory with these vars defined
from settings import API_ID, API_HASH, CHAT_ID
@Amar1729
Amar1729 / gtkrc
Created September 25, 2020 23:46
gruvbox gtk theme for Deluge.app
# Please keep this gtkrc in sync with the other ones from Clearlooks based themes.
# gruvbox - based colors
gtk-color-scheme = "base_color:#282828\nfg_color:#ebdbb2\ntooltip_fg_color:#bdae93\nselected_bg_color:#458588\nselected_fg_color:#282828\ntext_color:#928374\nbg_color:#3c3836\ntooltip_bg_color:#fabd2f"
style "default" {
xthickness = 1
ythickness = 1
#!/usr/bin/env python3
'''
Import Google Reader starred items to Pocket
============================================
This script will read the list of starred items generated by exporting your
Reader data using [Google Takeout][]. Generally you will use it like this:
python import-to-pocket.py starred.json
# sdkman recommands settings SDKMAN_DIR and sourcing sdkman-init.sh
# this can really slow down shell startup, so here's my attempt to lazy-load sdk()
#
# This snippet lives in my ~/.profile but generally could live in any zsh-related startup file.
#
# the logic of this custom sdk is kind of odd, but it basically checks if the current
# definition of sdk() is too short (less than 10 lines). If so, it tries to source
# the init script and then pass through all the arguments to the real sdk function.
export SDKMAN_DIR="$HOME/.sdkman"
@Amar1729
Amar1729 / ubuntu-local-download.md
Created December 10, 2019 23:30
Offline Ubuntu pkg installation

Download APT packages for an offline Ubuntu install

A fairly straightforward way to do this - short of spinning up a VM - is to use a docker image, e.g.:

# use whatever ubuntu version you are targeting, although there may be pkg version differences:
$ docker run -it ubuntu:18.04

# using docker makes things like spin up/copying text/deleting images faster, but keep in mind a few gotchas:
src/infer $ git checkout v0.17.0
M facebook-clang-plugins
Note: switching to 'v0.17.0'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
@Amar1729
Amar1729 / 0001-fix-update-to-head-script-more-robust.patch
Last active October 27, 2019 18:55
Proposed fixes for some pyrocore files.
From e8f099e3be53311cfec4bde0699de9559e972cb5 Mon Sep 17 00:00:00 2001
From: Amar1729 <amar.paul16@gmail.com>
Date: Tue, 22 Oct 2019 03:14:48 -0400
Subject: [PATCH 1/1] fix update-to-head script (more robust)
---
pavement.py | 12 +++++++-----
update-to-head.sh | 28 +++++++++++++++-------------
2 files changed, 22 insertions(+), 18 deletions(-)
@Amar1729
Amar1729 / neomake_java_helper.vim
Last active November 20, 2019 22:36
extend neomake's gradle classpath with javacomplete2
" -*- vim -*-
" FILE: neomake_java_helper.vim
" Function to help (neomake)[https://github.com/neomake/neomake/] find the
" gradle classpath.
" Uses (javacomplete2)[https://github.com/artur-shaik/vim-javacomplete2]
" to find and set the classpath.
function! s:GetBasePath()
return substitute(g:JavaComplete_GradlePath, 'build.gradle', 'src/main/java', '')
@Amar1729
Amar1729 / delete_bad_emojis.py
Last active September 28, 2022 19:05
Batch upload icon links as emojis to mattermost
#! /usr/bin/env python3
import os
import sys
import time
from typing import Any, Generator
# local
import iface