Skip to content

Instantly share code, notes, and snippets.

View valorad's full-sized avatar
🤕
è

Valorad the Oneiroseeker valorad

🤕
è
  • SCET
  • Dhirim
  • 13:52 (UTC -04:00)
View GitHub Profile
@clauda
clauda / pagine.js
Last active November 21, 2017 11:51
Mongoose Pagination #NodeJS #Express #MongoDB
var mongoose = require('mongoose');
mongoose.Query.prototype.paginate = function(page, limit, callback) {
var query = this
, page = page || 1
, limit = limit || 10
, offset = (limit * page) - limit;
query = query.skip(offset).limit(limit);
@wcxaaa
wcxaaa / docker_mySQL_Init.md
Last active February 22, 2018 03:47
Initializing docker mysql-server container
$ docker run --name mysql-c1 -d -v /workspace/docking:/workspace/docking mysql/mysql-server

Remember to wait for a few seconds and then continue.

$ docker logs mysql-c1 2>&1 | grep GENERATED # On Windows it's "findstr" instead of "grep"
# Copy that password from output: e.g. GENERATED ROOT PASSWORD: Axegh3kAJyDLaRuBemecis&EShOs
$ docker exec -it mysql-c1 mysql -u root -p
@DevWurm
DevWurm / entry.js
Last active March 4, 2019 15:21
angular-cli Electron configuration
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win
function createWindow () {
// Create the browser window.
@wcxaaa
wcxaaa / docker_mongo_Init.md
Last active March 23, 2020 14:01
Dockerized mongoDB initialization

First create a mongod config file. e.g.

# mongod.conf
# Where and how to store data.
storage:
  dbPath: /data/db
  directoryPerDB: true
  journal:
    enabled: true
@DjinnGA
DjinnGA / prepare-iso.sh
Last active April 4, 2021 01:59
Convert MacOS 10.14 Mojave Beta Installer App To iso File
#!/bin/bash
hdiutil create -o /tmp/Mojave.cdr -size 8g -layout SPUD -fs HFS+J
hdiutil attach /tmp/Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ 10.14\ Beta.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv /tmp/Mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ 10.14\ Beta
hdiutil convert ~/Desktop/InstallSystem.dmg -format UDTO -o ~/Desktop/Mojave.iso
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@wcxaaa
wcxaaa / btrfs-system-on-the-go.md
Created June 5, 2022 14:41
btrfs 子卷系统迁移清单

准备

要准备一个目标系统,或者至少要live cd

开始迁移 进chroot

  • 执行btrfs send 和 btrfs rec
  • 挂子卷,挂efi
  • /etc/fstab (删subvolid,改uuid, 加swap space)
  • /etc底下:hostname hosts resolv.conf
@agentsim
agentsim / highsierra_bootable.sh
Created June 10, 2017 02:23
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
# Install these packages (use your favorite AUR tool here)
yay -S minikube kubectl docker-machine-driver-kvm2 libvirt qemu-headless ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@dragonfire1119
dragonfire1119 / install-openwrt-on-proxmox.md
Last active March 6, 2024 21:33
Install OpenWRT on Proxmox