Skip to content

Instantly share code, notes, and snippets.

@kjellski
kjellski / sshd_config
Created July 6, 2013 18:59
This is an example real-world sshd_config with a nice little example at the end. A match clause that enables different setting for specific ranges than general settings...
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
@delimitry
delimitry / compiled_file_python_version.py
Last active May 20, 2024 04:22
Get the version of Python by which the file was compiled
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A script to get the version of Python by which the file was compiled
"""
from __future__ import print_function
import binascii
import os
import {
bufferFromFileOrString,
Cluster,
Config,
CoreV1Api,
KubeConfig,
Metrics,
topPods,
} from '@kubernetes/client-node';
import lodash, { Dictionary } from 'lodash';
@balvinder294
balvinder294 / fetch-file-from-url-spring-boot.java
Last active May 20, 2024 04:16
Fetch Image from URL and save locally in Spring Boot(Java)
Url imageUrl = new Url("https://site.com/image.jpeg"); // Sample url, replace with yours
String destinationFile = "sample.jpg";
/*******************Multipart Upload Method*********************************
** To resources like minio or DB
***************************************************************************/
/********
* Step 1
@vishal2376
vishal2376 / Place.kt
Last active May 20, 2024 04:14
Image Reflection with cool animation using Jetpack Compose
data class Place(
val name: String,
val resId: Int
)
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 20, 2024 04:07
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@qnnnnez
qnnnnez / issue.sh
Created February 24, 2019 12:01
nginx configuration for tls-alpn-01
# using https://github.com/Neilpang/acme.sh
acme.sh --issue -d your.domain.1 --alpn --tlsport 30443
@parmentf
parmentf / ConventionalCommitsEmoji.md
Last active May 20, 2024 03:18
Emoji for Conventional Commits
Type Emoji code
feat :sparkles:
fix 🐛 :bug:
docs 📚 :books:
style 💎 :gem:
refactor 🔨 :hammer:
perf 🚀 :rocket:
test 🚨 :rotating_light:
build 📦 :package:
@Lua12138
Lua12138 / Install-Hyper-V.bat
Created October 4, 2020 05:05
Install Hyper-V with Windows Home Edition (run with Administrator) / Windows 家庭版安装hyper-v(使用管理员身份运行)
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL