Skip to content

Instantly share code, notes, and snippets.

@xsephiroth
xsephiroth / 50-usb-mount.rules
Created June 19, 2018 14:14
udev mount usb by pid uid
# /etc/udev/rules.d/50-usb-mount.rules
ACTION=="add",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/mkdir -p /media/abc",RUN+="/bin/mount -o relatime,sync,utf8,uid=1000,gid=1000,umask=002 /dev/%k /media/abc"
ACTION=="remove",ATTRS{idVendor}=="0951",ATTRS{idProduct}=="1643",RUN+="/bin/umount -l /media/acc",RUN+="/bin/rmdir /media/abc"
package main
import (
"io"
"log"
"os"
"os/exec"
"io/ioutil"
"bytes"
)
@xsephiroth
xsephiroth / CryptoJs & Golang
Last active April 10, 2025 02:11
AES decrypt encrypt with CryptoJs & Golang
<template>
<div>
</div>
</template>
<script>
import CryptoJs from "crypto-js"
export default {
name: "",
data(){
@xsephiroth
xsephiroth / GitConfigHttpProxy.md
Created October 26, 2017 13:53 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@xsephiroth
xsephiroth / main.js
Created September 24, 2017 06:51
electron x-frame-options
const {session} = require('electron')
const {ipcMain} = require('electron')
ipcMain.on('disable-x-frame', (event, arg) => {
session.fromPartition(arg.partition).webRequest.onHeadersReceived({}, (d, c) => {
if(d.responseHeaders['x-frame-options'] || d.responseHeaders['X-Frame-Options']){
delete d.responseHeaders['x-frame-options'];
delete d.responseHeaders['X-Frame-Options'];
@xsephiroth
xsephiroth / default.conf
Created August 31, 2017 13:07
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;