Skip to content

Instantly share code, notes, and snippets.

@blacknon
blacknon / notworking_ssh_term_x11forwarding.go
Last active August 14, 2023 07:59
goでx11フォワーディング付きでssh接続でシェルを利用する検証・サンプルコード(動かない)
package main
import (
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"golang.org/x/crypto/ssh"
@wangruohui
wangruohui / intel-nvidia.md
Last active June 21, 2024 21:51
Intel for display, Nvidia for computing

Intel for display, NVIDIA for computing

This guide will show you how to use Intel graphics for rendering display and NVIDIA graphics for CUDA computing on Ubuntu 18.04 / 20.04 desktop.

I made this work on an ordinary gaming PC with two graphics devices, an Intel UHD Graphics 630 plus an NVIDIA GeForce GTX 1080 Ti. Both of them can be shown via lspci | grep VGA.

00:02.0 VGA compatible controller: Intel Corporation Device 3e92
01:00.0 VGA compatible controller: NVIDIA Corporation GP102 [GeForce GTX 1080 Ti] (rev a1)
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@andersgs
andersgs / job_array_demo.sh
Created February 27, 2018 21:53
Slurm job arrays
#!/bin/bash
# Illustrating the use of job arrays in SLURM
# use the command: sbatch --array=1-100 job_array_demo.sh
# Partition for the job:
#SBATCH -p main
# Multithreaded (SMP) job: must run on one node
#SBATCH --nodes=1
@jfrancoa
jfrancoa / swift-disable.yaml
Created September 8, 2017 10:55
Ansible playbook to disable multiple systemd services
---
- hosts: 127.0.0.1
connection: local
gather_facts: no
tasks:
- name: Check if swift-storage services are deployed
command: systemctl is-enabled --quiet "{{ item }}"
register: swift_services_enabled
ignore_errors: true
@gera2ld
gera2ld / test-violentmonkey.user.js
Last active March 28, 2023 23:39
Test Violentmonkey functions
// ==UserScript==
// @name test script
// @namespace Violentmonkey Scripts
// @icon https://cn.gravatar.com/avatar/a0ad718d86d21262ccd6ff271ece08a3?s=80
// @homepage https://gist.github.com/gera2ld/1c14672b77ade31ad8f0984725de18fc
// @resource baidu https://www.baidu.com/img/baidu_jgylogo3.gif
// @resource text data:text/plain,hello,world
// @resource mochaCss https://cdn.jsdelivr.net/npm/mocha@7.0.1/mocha.min.css
// @resource cjk https://cdn.jsdelivr.net/gh/intellilab/translator.user.js/README.md
// @run-at document-start
@madcoda
madcoda / App.js
Created May 28, 2017 04:24
React-router v4 multi layout
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Match, Redirect, Switch } from 'react-router-dom'
import OverviewPage from './page/OverviewPage'
import AccountPage from './page/AccountPage'
/*
Layouts, inline define here for demo purpose
you may want to define in another file instead
*/
@mertcangokgoz
mertcangokgoz / tftpServer.sh
Last active January 19, 2023 04:28
macOS Sierra and Missing TFTP Server Management Tool
#!/bin/bash
# macOS Sierra TFTP Server Creator
# Author Mertcan GÖKGÖZ - 07.05.2017 15:00 (GMT +3)
#
# Requirements
# - Macos Sierra 10.12.4 and later
# - 'homebrew' package manager
# - brew install dialog
#
# How to use
@gnilchee
gnilchee / docker-compose-consul.yml
Created October 28, 2016 06:04
Stand up a single node consul server and export ui/api over port 80 and consul dns over port 53
version: '2'
services:
consul:
image: consul
volumes:
- ./data/consul:/consul/data
command: /bin/consul agent -server -data-dir="/consul/data" -bootstrap -client="0.0.0.0" -advertise="127.0.0.1" -ui
ports:
- 80:8500 #HTTP API/UI
- 53:8600/udp #DNS
@Alir3z4
Alir3z4 / utils.py
Created August 9, 2016 06:19
Create a hash of a file on upload time and save it for Django FileField/ImageField
def hash_file(file, block_size=65536):
hasher = hashlib.md5()
for buf in iter(partial(file.read, block_size), b''):
hasher.update(buf)
return hasher.hexdigest()
def upload_to(instance, filename):
"""