Skip to content

Instantly share code, notes, and snippets.

View scmanjarrez's full-sized avatar
🧠
hungry mind

Sergio C scmanjarrez

🧠
hungry mind
  • Spanish National Research Council (CSIC)
  • Madrid
View GitHub Profile
@scmanjarrez
scmanjarrez / tmux-migrate-options.py
Created October 10, 2019 16:07 — forked from tbutts/tmux-migrate-options.py
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
scrollbar, scrollbar *, scrollcorner {
-moz-appearance: none !important;
--scrollbar-width: 10px;
--scrollbar-height: var(--scrollbar-width);
}
scrollbar, scrollcorner {
background: #282828 !important;
}
scrollbar[orient="vertical"] {
@scmanjarrez
scmanjarrez / guake bright colors
Last active August 2, 2020 10:19
guake bright colors
#!/bin/bash
#gconftool-2 -s -t string /apps/guake/style/font/palette "#263238:#ec407a:#8bc34a:#ffa726:#2196f3:#9575cd:#00bcd4:#eceff1:#617d8a:#ec407a:#9ccc65:#ffb74d:#42a5f5:#b39ddb:#26c6da:#ffffff"
#gconftool-2 -s -t string /apps/guake/style/font/color "#ffffffffffff"
#gconftool-2 -s -t string /apps/guake/style/background/color "#263238"
dconf write /apps/guake/style/font/palette "'#000000000000:#cccc00000000:#4e4e9a9a0606:#c4c4a0a00000:#34346565a4a4:#757550507b7b:#060698209a9a:#d3d3d7d7cfcf:#555557575353:#efef29292929:#8a8ae2e23434:#fcfce9e94f4f:#72729f9fcfcf:#adad7f7fa8a8:#3434e2e2e2e2:#eeeeeeeeecec:#ffffffffffff:#000000000000'"
@scmanjarrez
scmanjarrez / guake2iterm.sh
Last active August 2, 2020 12:17
Convert guake current theme to iterm theme.
#!/bin/bash
while getopts ":o:" opt; do
case ${opt} in
o) output=$OPTARG ;;
esac
done
if [ -z "$output" ]; then
echo "Usage: $0 -o output_file"
@scmanjarrez
scmanjarrez / route.sh
Last active February 16, 2021 09:49
fix routing (ssh) when connected to openvpn
# https://serverfault.com/questions/659955/allowing-ssh-on-a-server-with-an-active-openvpn-client
# https://serverfault.com/a/660106
ip rule add from x.x.x.x table 128
ip route add table 128 to y.y.y.y/y dev ethX
ip route add table 128 default via z.z.z.z
# Where x.x.x.x is your public IP, y.y.y.y/y should be the subnet
# of your public IP address, ethX should be your public Ethernet
# interface, and z.z.z.z should be the default gateway.
# Note that this hasn't worked for me (using Debian and PrivateInternetAccess)
@scmanjarrez
scmanjarrez / userChrome.css
Last active August 13, 2021 13:31
firefox context menu and tab context menu css for linux http://imgur.com/fv4L3Cwl.png
menupopup {
--panel-background: var(--arrowpanel-background) !important;
--panel-color: var(--arrowpanel-color) !important;
--panel-border-color: var(--arrowpanel-border-color) !important;
--panel-border-radius: var(--arrowpanel-border-radius) !important;
--panel-padding: var(--arrowpanel-padding) !important;
}
menuseparator {
appearance: inherit !important;
@scmanjarrez
scmanjarrez / main.py
Created February 15, 2022 18:28 — forked from keithel/main.py
Access a ChartView's series in QML imperatively
from pathlib import Path
import sys
from PySide6.QtCore import QUrl, QObject, Property, Signal, Slot
from PySide6.QtWidgets import QApplication
from PySide6.QtQml import QmlElement, QQmlApplicationEngine
from PySide6.QtCharts import QAbstractSeries
QML_IMPORT_NAME = "name.kyzivat.piechart_example"
QML_IMPORT_MAJOR_VERSION = 1
@scmanjarrez
scmanjarrez / README.md
Last active April 7, 2022 22:01
Export threejs json to stl (used with thigiverse js models: example: https://cdn.thingiverse.com/threejs_json/16/3f/4e/a9/e6/large.js)
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field separator to line break, so that we can iterate easily over the verify-pack output
@scmanjarrez
scmanjarrez / gist:53d43d5aee335a809a9fc1eb81c39f00
Created May 17, 2022 09:57 — forked from zakkak/gist:ab08672ff9d137bbc0b2d0792a73b7d2
Resizing a filesystem using qemu-img and fdisk

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For