Skip to content

Instantly share code, notes, and snippets.

@zinbers
zinbers / nvidia.md
Created December 14, 2020 09:00 — forked from bitsurgeon/nvidia.md
install Nvidia driver on Ubuntu with Secure Boot

Install Nvidia Driver on Ubuntu 18.04.3

Secure Boot

This section applies to machines with Secure Boot, such as ThinkPad.

  1. Before installation, switch to "Discrete Graphics" in BIOS, if both Intel and Nvidia graphics are present.
  2. During installation, make sure to select the "Install third-party software for graphics and Wi-Fi hardware and addition media formats" in "Updates and other software" screen.
  3. Select "Configure Secure Boot", and set password.
  4. Continue Ubuntu installation as normal.
@zinbers
zinbers / threaded_download.py
Created October 19, 2020 05:42 — forked from chandlerprall/threaded_download.py
Small Python multi-threaded file downloader
import urllib2
import threading
from Queue import Queue
import sys, os, re
class ThreadedDownload(object):
REGEX = {
'hostname_strip':re.compile('.*\..*?/', re.I)
}
@zinbers
zinbers / Install_Qt.md
Created June 29, 2020 08:22 — forked from raulqf/Install_Qt.md
How to install Qt libraries on Linux from source code

How to install Qt on Linux from source code

One of the best option is to use the run package offered by Qt to install the libraries and its IDE (Qt Creator). Nevertheless However, when you want to compile it for a sever, where no GUI is required, you must be then interested in how to compile from source and discover some of the configuration options you have to disable some GUI modules among others and get lightest weight libraries.

First of all download the tar.xz file from Qt. You can also go to the archive and select the best that fulfill your requirement. Right now I am going on with the newest version up to the moment v5.9.3.

Create a directory and uncompress the downloaded file:

  $ mkdir temp

$ cd temp

@zinbers
zinbers / nvidia_drivers.md
Created June 29, 2020 08:21 — forked from raulqf/nvidia_drivers.md
Install Nvidia Drivers - Ubuntu

How to install NVIDIA Drivers

Disable nouveau (if required) - free and open source graphi device driver for Nvidia video cards.

First disable nouveau free/libre software drivers for NVIDIA using blacklist:

$ sudo vim /etc/modprobe.d/blacklist.conf

And include:

blacklist nouveau

@zinbers
zinbers / Install_OpenCV4_CUDA10.md
Created June 29, 2020 08:19 — forked from raulqf/Install_OpenCV4_CUDA12.6_CUDNN8.9.md
How to install OpenCV 4.2 with CUDA 10.0 in Ubuntu 18.04

How to install OpenCV 4.2.0 with CUDA 10.0 in Ubuntu distro 18.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@zinbers
zinbers / longpress.h
Created June 4, 2020 06:01 — forked from jniemann66/longpress.h
Qt: Event Filter for Long Mouse Press (hold mouse for >= 1sec)
// LongPress: event filter Object for detecting Mouse pressed down for 1 second or more
// when triggered, it executes callback function supplied in the constructor
// usage:
/*
someButton->installEventFilter(new LongPress(this, [this] {
// do some stuff
}));
*/
@zinbers
zinbers / Installing Google Test on Mac.md
Created March 14, 2020 14:20 — forked from butuzov/Installing Google Test on Mac.md
Bash Script to install Google Test and Google Mock on Mac

Installing Google Test on Mac

One bash script to install google test (and mock) on your Mac. I assume you already had install cmake (if not, use brew - brew install cmake).

It use brew directories to store gmock and gtest.

gtest_installer.sh

#!/usr/bin/env bash
@zinbers
zinbers / wiresharkbuild.md
Created October 16, 2019 11:09 — forked from keomabrun/wiresharkbuild.md
building wireshark on Windows 7 x64

Try to avoid building Wireshark on Windows as much as you can. Read the following only if you have no other choice. I use Jenkins to build Wireshark on Windows. Jenkins just run the .bat file.

Advices:

  • Don't use Visual Studio 2012 but 2013 or newer.
  • Use Chocolatey as much as possible.
  • Don't mess around with regedit

PATH

Here is my PATH before running the script:

@zinbers
zinbers / XorCipher.lua
Created June 15, 2018 11:42 — forked from obikag/XorCipher.lua
XOR Cipher in Lua. See comments for more information.
cipher = "10101111" -- must be eight digit binary number
--Returns the XOR of two binary numbers
function xor(a,b)
local r = 0
local f = math.floor
for i = 0, 31 do
local x = a / 2 + b / 2
if x ~= f(x) then
r = r + 2^i

1:设置

sudo vi /etc/sysctl.conf
net.ipv4.ip_forward=1
sudo sysctl -p

2:安装

https://www.wireguard.com/install/