Skip to content

Instantly share code, notes, and snippets.

Avatar
💜

Leigh Johnson leigh-johnson

💜
View GitHub Profile
View Bitbake-Cheatsheet.md

Bitbake Cheatsheet

Verbose as possible

bitbake -vDDD your-recipe

List recipes

bitbake -s
@lizthegrey
lizthegrey / attributes.rb
Last active January 17, 2023 22:50
Hardening SSH with 2fa
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@Mahedi-61
Mahedi-61 / cuda_11.3_installation_on_Ubuntu_20.04
Last active March 23, 2023 04:00
Instructions for CUDA v11.3 and cuDNN 8.2 installation on Ubuntu 20.04 for PyTorch 1.11
View cuda_11.3_installation_on_Ubuntu_20.04
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active March 9, 2023 21:32
GCC compiler optimization for ARM-based systems
View gcc compiler optimization for arm systems.md

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active March 23, 2023 09:58
Updated to the Keras 2.0 API.
View classifier_from_little_data_script_1.py
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
View pg-pong.py
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@davidosomething
davidosomething / README.md
Last active April 12, 2017 09:37
Nightwatch/Selenium test vs CasperJS/PhantomJS test
View README.md

This is roughly the same test run in both casper and nightwatch.

@simonrw
simonrw / python_pymysql_notes.md
Created September 18, 2015 19:01
Notes about pymysql connections
View python_pymysql_notes.md

Database transactions

pymysql

  • Defaults to autocommit=False
connection = pymysql.connect(user='user', db='test')
cursor = connection.cursor()
cursor.execute('insert into test (value) values (10)')
@oyvindholmstad
oyvindholmstad / schema-generator.js
Last active September 21, 2018 06:54
BigQuery JSON schema generator in Javascript and Scala
View schema-generator.js
/*
A script to generate a Google BigQuery-complient JSON-schema from a JSON object.
Make sure the JSON object is complete before generating, null values will be skipped.
References:
https://cloud.google.com/bigquery/docs/data
https://cloud.google.com/bigquery/docs/personsDataSchema.json
https://gist.github.com/igrigorik/83334277835625916cd6
... and a couple of visits to StackOverflow
@garystafford
garystafford / Replace-Docker-Compose-Variables.md
Last active April 14, 2019 00:54
Use variables within your Docker Compose YAML file, using simple shell script and YAML template
View Replace-Docker-Compose-Variables.md

For a small number of variables ('tokens'), I use a simple shell script along with a templated version of my YAML file. Here's an actual example:

files:

docker-compose-template.yml
docker-compose.yml
compose_replace.sh

run: