Skip to content

Instantly share code, notes, and snippets.

View janoskk's full-sized avatar
🏠
Working from home

Janos Kasza janoskk

🏠
Working from home
  • Budapest, Hungary
View GitHub Profile
@janoskk
janoskk / couchclone.sh
Created May 28, 2014 22:27
Create (if necessary) and replicate all databases from a couchdb server to another one
#!/bin/sh
#
# Janos Kasza (@janoskk)
#
# Creates (if necessary) and replicates all databases from a couchdb server to another one
#
if [ -z "$2" ]; then
cat <<EOF
Usage: $0 <sourceUrl> <targetUrl>
@janoskk
janoskk / class-ES5.js
Last active August 29, 2015 14:13
Quick example on how to use the prototype-based object-oriented programming in JavaScript.
/*
* Generated code from class-ES6.js with 6to5. This code can be used anywhere today.
*/
"use strict";
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
var _prototypeProperti
@janoskk
janoskk / vimrc
Created January 28, 2018 19:54
My current .vimrc thanks to Amir Salihefendic
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 5.0 - 29/05/12 15:43:36
"
" Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
@janoskk
janoskk / renew-gpgkey.md
Created October 8, 2020 14:05 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@janoskk
janoskk / suspend_on_power_button.md
Last active January 18, 2023 20:03
Suspend on power button (Ubuntu 21.04)

Set user's settings

$ gsettings set org.gnome.settings-daemon.plugins.power button-power 'suspend'
$ gsettings set org.gnome.settings-daemon.plugins.power power-button-action 'suspend'

Set gdm user's settings

sudo su --login gdm --shell /bin/bash
gdm$ dbus-launch --exit-with-session gsettings set org.gnome.settings-daemon.plugins.power button-power 'suspend' 
@janoskk
janoskk / authorized_keys on Win10.md
Last active November 2, 2021 09:45
Authorized keys on Windows 10 server

TL;DR of a very useful readme from https://gist.github.com/asheroto/80d5f85e90d92e7f8e40e9d1a3dea7ad:

On the client

export USER_AT_HOST="host-to-ssh"
export PUBKEYPATH="$HOME/.ssh/id_rsa.pub"
ssh $USER_AT_HOST  "powershell New-Item -Force -ItemType Directory -Path \"\$HOME\\.ssh\"; Add-Content -Force -Path \"\\programdata\\ssh\\administrators_authorized_keys\" -Value '$(tr -d '\n\r' < "$PUBKEYPATH")'"

On the server

@janoskk
janoskk / pdbdump.c
Created August 5, 2022 18:23 — forked from mridgers/pdbdump.c
Small tool to list and query symbols in PDB files.
//------------------------------------------------------------------------------
// pdbdump.c - dump symbols from .pdb and executable files (public domain).
// - to compile; cl.exe /Ox /Zi pdbdump.c
// -
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk
//------------------------------------------------------------------------------
#include <stdio.h>
#include <Windows.h>
#include <DbgHelp.h>