show dbs
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Starting Docker installation on Deepin Linux..." | |
# Define a mapping from Deepin version to Debian version | |
map_deepin_to_debian() { | |
if [ "$1" -lt 20 ]; then | |
echo "stretch" | |
elif [ "$1" -ge 20 ]; then | |
echo "buster" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Admins::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
def google_oauth2 | |
admin = Admin.from_google(from_google_params) | |
if admin.present? | |
sign_out_all_scopes | |
flash[:success] = t 'devise.omniauth_callbacks.success', kind: 'Google' | |
sign_in_and_redirect admin, event: :authentication | |
else | |
flash[:alert] = t 'devise.omniauth_callbacks.failure', kind: 'Google', reason: "#{auth.info.email} is not authorized." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript -l JavaScript | |
/** | |
* ----------------------------------------------------------------------------- | |
* Activate Sidecar/Screen Mirroring from Control Center | |
* ----------------------------------------------------------------------------- | |
* | |
* Created on February 17, 2023 by Stephan Casas | |
* Updated on May 18, 2023 by Stephan Casas | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreFoundation | |
// all keycodes: https://gist.github.com/swillits/df648e87016772c7f7e5dbed2b345066 | |
let KeyCode_R: UInt16 = 0x0F; | |
let KeyCode_N: UInt16 = 0x2D; | |
let src = CGEventSource(stateID: CGEventSourceStateID.hidSystemState) | |
let kspd = CGEvent(keyboardEventSource: src, virtualKey: KeyCode_R, keyDown: true) // space-down | |
let kspu = CGEvent(keyboardEventSource: src, virtualKey: KeyCode_R, keyDown: false) // space-up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CLI | |
sudo apt update -y | |
sudo apt install -y \ | |
git curl \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ | |
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \ | |
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \ | |
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \ | |
rbenv apache2-utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
from pygame.locals import * | |
pygame.init() | |
screen = pygame.display.set_mode((640, 480)) | |
running = 1 | |
while running: | |
for event in pygame.event.get(): |
CNs are important!!! -days 3650
openssl req -newkey rsa:2048 -new -x509 -days 3650 -nodes -subj '/C=US/ST=Massachusetts/L=Bedford/O=Personal/OU=Personal/emailAddress=example@example.com/CN=localhost' -out mongodb-cert.crt -keyout mongodb-cert.key
cat mongodb-cert.key mongodb-cert.crt > mongodb.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base_model: mistral-community/Mixtral-8x22B-v0.1 | |
model_type: MixtralForCausalLM | |
tokenizer_type: AutoTokenizer | |
is_mistral_derived_model: false | |
trust_remote_code: true | |
load_in_8bit: false | |
load_in_4bit: true | |
strict: false |
NewerOlder