Skip to content

Instantly share code, notes, and snippets.

@vladwa
vladwa / SSH.py
Created December 31, 2017 07:30
Python code to execute command as a sudo user over ssh connection on a remote server using "paramiko" module. On The code snippet establishes connection and executes the command and return the status and output of the executed command.
import logging
import paramiko
class SSH:
def __init__(self):
pass
def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password):
"""Establishes a ssh connection to execute command.
:param ssh_machine: IP of the machine to which SSH connection to be established.
@devomman
devomman / office-activation.md
Created May 30, 2023 11:01
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@Siguza
Siguza / pallas.sh
Last active May 21, 2024 13:35
newstyle OTA
#!/usr/bin/env zsh
set -e;
set +m; # Job control would've been nice, but manual round robin it is, sigh.
if [ -z "${ZSH_VERSION+x}" ]; then
echo 'Try again with zsh.';
exit 1;
fi;
@sefacan
sefacan / 2019-all-turkey-banks-binlist.csv
Last active May 21, 2024 13:35
Güncel BKM Tüm Bankalar Bin Listesi - Ekim 2019
MemberNo MemberName PrefixNo CardType BusinessCard
10 T.C.ZİRAAT BANKASI A.Ş. 404591 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 407814 DEBIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 413226 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 444676 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 444677 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 444678 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 447504 DEBIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 454671 CREDIT CARD false
10 T.C.ZİRAAT BANKASI A.Ş. 454672 CREDIT CARD false
@TALlama
TALlama / anonymizer.rb
Created May 17, 2024 16:03
This class will use your existing FactoryBot factories to rewrite the data already in the db, keeping the associations and structure but replacing the content.
class Anonymizer
include ActiveSupport::Benchmarkable
attr_reader :factory_names, :callbacks
def initialize(factory_names = nil, callbacks = {})
raise ArgumentError.new("You must be in development to use the anonymizer") unless Rails.env.development?
require Rails.root.join("spec/factories") unless FactoryBot.factories.count > 0
@factory_names = [*factory_names].compact.map(&:to_sym)
@justvanrossum
justvanrossum / rename_fea_glyphs.py
Last active May 21, 2024 13:32
Rename glyph names in OpenType feature files
from functools import singledispatch
from io import StringIO
from fontTools.feaLib import ast
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.parser import Parser
def renameGlyphs(feaSource, renameFunc, glyphNames=()):
features = Parser(StringIO(feaSource), glyphNames=glyphNames).parse()
@findneo
findneo / BT 磁力搜索引擎索引
Created November 16, 2020 13:46 — forked from huazhanshen/BT 磁力搜索引擎索引
BT 磁力搜索引擎索引
btkitty
知名的BT磁力搜索,资源很多
http://cnbtkitty.com/
备用域名:http://btkitty.fyi/
idope.se
资源丰富的BT磁力搜索,并且大多数速度下载速度很快
https://idope.se/
@UrsaDK
UrsaDK / Caching multi-stage builds in GA.md
Last active May 21, 2024 13:31
Speed up your multistage builds in GitHub Actions

Caching multi-stage builds in GitHub Actions

Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:

  1. Build images via a standard docker build command, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.

  2. Build your images via docker integrated BuildKit (DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.

The problem

@boxabirds
boxabirds / main.go
Created May 21, 2024 12:00
Demo of how to create a summariser using golang and Anthropic Claude.
package main
import (
"context"
"flag"
"fmt"
"io"
"log"
"os"
"time"
@0xjac
0xjac / private_fork.md
Last active May 21, 2024 13:30
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git