Skip to content

Instantly share code, notes, and snippets.

View valorad's full-sized avatar
🤕
è

Valorad the Oneiroseeker valorad

🤕
è
  • SCET
  • Dhirim
  • 21:58 (UTC -05:00)
View GitHub Profile
@valorad
valorad / linwcmd.cmd
Created March 17, 2017 06:57
Linuxified Windows Command Prompt
alias cd=chdir /d $*
alias cp=xcopy /H $*
alias ls=dir
alias mv=move $*
alias rm=rmdir $*
@valorad
valorad / mongoDump.bat
Last active September 21, 2019 22:33
Mongo 豪华小命令
mongodump --uri "mongodb://[adminUser]:[password]@127.0.0.1:27017/[dbName]?authSource=admin" -o [path out e.g. M:\backup]
@valorad
valorad / nginx_modsite
Created March 31, 2017 04:49
Nginx enable/disable site config by Ghassen Telmoudi from serverfault.com
#!/bin/bash
##
# File:
# nginx_modsite
# Description:
# Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories:
# /etc/nginx/sites-available and /etc/nginx/sites-enabled
# For easy access to this script, copy it into the directory:
@valorad
valorad / lxcli_proxy.sh
Created April 12, 2017 10:15
linux command line tools use proxy
enable_proxy() {
export http_proxy="127.0.0.1:1080"
export https_proxy="127.0.0.1:1080"
}
disable_proxy() {
unset http_proxy
unset https_proxy
}
@valorad
valorad / addTo.bashrc.sh
Last active January 22, 2018 12:09
安装yarn的正确姿势(有版本管理器如nvm存在时) How to install Yarn when node is under version management (such as nvm)
# 开启yarn global
# 添加到 ~/.bashrc 最后
# add yarn global
export PATH=$PATH:$HOME/.yarn/bin
@valorad
valorad / mcross.sh
Created October 22, 2017 02:21
magical crossover
# .bashrc
mcross() {
export http_proxy=http://127.0.0.1:1080;
export https_proxy=http://127.0.0.1:1080;
}
mback() {
unset http_proxy;
unset https_proxy;
@valorad
valorad / 40_custom
Created November 25, 2017 04:41
Grub ultimate bootality
#!/bin/sh
# MIT License
# Copyright (c) 2017 Xiaomajia Alliance
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@valorad
valorad / pMountSF.service
Last active April 16, 2018 08:05
Mount Parallel Desktop Shared Folder to workspace as a non-root user (uid=1000)
[Unit]
Description=Mount Parallel Desktop Shared Folder to workspace as a non-root user (uid=1000)
[Service]
ExecStart=/bin/bash /workspace/pMountSF.sh
[Install]
WantedBy=multi-user.target
@valorad
valorad / pcProbe.ps1
Created November 3, 2018 23:53
Probe Windows PC Info
$output = "./awesomeLibLaptop.txt"
Get-CimInstance -ClassName Win32_Desktop -ComputerName . >> $output
Get-CimInstance -ClassName Win32_Desktop -ComputerName . >> $output
Get-CimInstance -ClassName Win32_BIOS -ComputerName . >> $output
Get-CimInstance -ClassName Win32_Processor -ComputerName . >> $output
Get-CimInstance -ClassName Win32_ComputerSystem >> $output
Get-CimInstance -ClassName Win32_OperatingSystem -ComputerName . >> $output
Get-CimInstance -ClassName Win32_LogicalDisk >> $output
Get-CimInstance -ClassName Win32_LogonSession >> $output
@valorad
valorad / vMountSF.sh
Last active January 22, 2019 02:18
Mount Virtual Box Shared Folder to workspace as a non-root user (uid=1000, gid=1000)
sleep 5
sfs=`ls /media`
for folder in ${sfs[@]}; do name=${folder#*sf_}; mkdir -p /workspace/$name; mount -t vboxsf -o uid=1000,gid=1000 $name /workspace/$name; done
# usage
# - Create shared folders from virtualbox interface. No need to auto-mount