Skip to content

Instantly share code, notes, and snippets.

@otkrsk
otkrsk / multiple-ssh-authkeys.md
Last active May 6, 2024 14:12
Add multiple SSH keys to the authorized_keys file to enable SSH authentication when connecting to a server.

Step 1: Generate first ssh key Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.

workstation 1 $ ssh-keygen -t rsa

Finally, copy your public key to your remote server using scp

@Ynng
Ynng / custom.css
Last active May 6, 2024 14:10
vscode vtuber logo
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode-Thick.png") !important;
opacity: .75;
aspect-ratio: 3/2 !important;
}
@mingalevme
mingalevme / php-redis-custom-flags.sh
Created March 1, 2020 11:46
Installing PHP Redis extension inside PHP-Alpine-based Docker container
NPROC=$(getconf _NPROCESSORS_ONLN)
mkdir -p /usr/src/php/ext
cd /usr/src/php/ext
pecl bundle redis
docker-php-ext-configure redis --enable-redis-igbinary --enable-redis-lzf
docker-php-ext-install -j${NPROC} redis
cd -
@LoganTann
LoganTann / buildSVP.sh
Last active May 6, 2024 14:14
Build SVP for ubuntu 20.04
## source : https://www.youtube.com/watch?v=ABrO2kdXCWE
## but I fixed some bugs
## this installs dependancies used to get the dependancies and some sources + build tools
sudo apt-get update
sudo apt-get install g++
sudo apt-get update -y
sudo apt-get install -y beignet-opencl-icd
sudo apt-get install mediainfo
sudo apt-get install libqt5concurrent5 libqt5svg5 libqt5qml5
@oelbaga
oelbaga / 01 - Setup Nextjs site on Ubuntu Server - Terminal commands
Last active May 6, 2024 14:06
Setup NextJS app on Digital Ocean Ubuntu server Full Terminal Commands Step by Step
#Setup NextJS on Ubuntu server (Digital Ocean, EC2,...) Terminal Commands
#based on my YouTube video
#Recommended: An ubuntu server with at least 2 GB memory to handle npm run build
#login to server
ssh root@ip_address
#Upgrade Server - may take a few minutes
sudo apt update
sudo apt upgrade
@aws-scripting-guy
aws-scripting-guy / azure-devops-predefined-variables-in-the-scripts.md
Last active May 6, 2024 14:05
Azure DevOps tips: Using predefined variables in the scripts

Azure DevOps Pipelines: How to access predefined variables from scripts

In this scenario we want to access predefined variable $Build.Reason from the PowerShell script. $Build.Reason will have different value based on what triggered the build.

Configure azure-pipelines.yml

Map $Build.Reason to env variable for the powershell script.

- powershell: |
 .\scripts\git-package.ps1
@yigiteren
yigiteren / MeshCombiner.cs
Created October 21, 2021 09:54
A mesh combining example for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshCombiner : MonoBehaviour
{
[SerializeField] private List<MeshFilter> sourceMeshFilters;
[SerializeField] private MeshFilter targetMeshFilter;
[ContextMenu("Combine Meshes")]
@Quiark
Quiark / sandbox.h
Created January 2, 2020 07:00
restricted version of sbtool that is compilable
// courtesy of clang
// https://github.com/applesrc/clang/blob/bb8f644/src/projects/compiler-rt/lib/sanitizer_common/sanitizer_mac_spi.cc
enum sandbox_filter_type {
SANDBOX_FILTER_NONE,
SANDBOX_FILTER_PATH,
SANDBOX_FILTER_GLOBAL_NAME,
SANDBOX_FILTER_LOCAL_NAME,
SANDBOX_FILTER_APPLEEVENT_DESTINATION,
@hopsoft
hopsoft / db.rake
Last active May 6, 2024 14:00
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@styblope
styblope / docker-api-port.md
Last active May 6, 2024 14:00
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}