Skip to content

Instantly share code, notes, and snippets.

View bymaximus's full-sized avatar

bymaximus

  • Seeking new dragons
  • Brazil, Cataguases / MG
View GitHub Profile
@dsibilly
dsibilly / gist:2992412
Created June 26, 2012 01:00
Node.js clustered HTTP server example
(function () {
'use strict';
var cluster = require('cluster'),
http = require('http'),
os = require('os'),
/*
* ClusterServer object
@vadviktor
vadviktor / base64.sql
Created March 11, 2014 14:40
Legacy MySQL (v 5.1) BASE64 functions
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for base64_data
-- ----------------------------
DROP TABLE IF EXISTS `base64_data`;
CREATE TABLE `base64_data` (
`c` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`val` tinyint(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@tsolar
tsolar / laravel-subdirectory.conf
Last active February 5, 2025 05:29
Laravel in subdirectory nginx example
server {
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 300M;
sendfile on;
send_timeout 300s;
# Port that the web server will listen on.
#listen 80;
@leftclickben
leftclickben / gist:322b7a3042cbe97ed2af
Last active June 7, 2023 10:58
Steps to migrate from SVN to GitLab

Steps to migrate from SVN to GitLab

This process worked for me. I take no responsibility for any damage or loss incurred as a result of following or not following these steps or, for that matter, anything else you might do or not do.

Setup

  • SVN is hosted at svn.domain.com.au.
  • SVN is accessible via http (other protocols should work).
  • GitLab is hosted at git.domain.com.au and:
@mfurlend
mfurlend / composer.json
Last active September 11, 2024 13:35
composer require git repository
{
"name": "my_vendor_name/my_package",
"description": "My Package Description",
"license": "GPL-3.0",
"autoload": {
"classmap": [ // search these directories for classes
"lib/"
]
},
"repositories": {
@ksingh7
ksingh7 / enable-root-login-cloud-init
Created April 16, 2016 20:55
enable root login from cloud-init
$ sudo perl -i -pe 's/disable_root: 1/disable_root: 0/' /etc/cloud/cloud.cfg
$ sudo perl -i -pe 's/#PermitRootLogin .*/PermitRootLogin without-password/' /etc/ssh/sshd_config
$ sudo perl -i -pe 's/.*(ssh-rsa .*)/\1/' /root/.ssh/authorized_keys
$ sudo /etc/init.d/sshd reload # optional command
@bjorn-ali-goransson
bjorn-ali-goransson / AwsAuthenticator.cs
Created May 4, 2016 17:20
Authenticate to AWS with RestSharp (nicked from minio-dotnet / V4Authenticator with minor modifications)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
namespace Rest.Authentication
{
public class AwsAuthenticator : RestSharp.Authenticators.IAuthenticator
{
public string AccessKeyId { get; }
@gskema
gskema / color-gradient.js
Last active March 2, 2024 22:14
Generate gradient color from 2 or 3 colors using JavaScript. Example: https://jsfiddle.net/e18g5f3L/
/**
* You may use this function with both 2 or 3 interval colors for your gradient.
* For example, you want to have a gradient between Bootstrap's danger-warning-success colors.
*/
function colorGradient(fadeFraction, rgbColor1, rgbColor2, rgbColor3) {
var color1 = rgbColor1;
var color2 = rgbColor2;
var fade = fadeFraction;
// Do we have 3 colors for the gradient? Need to adjust the params.
@knotdevel
knotdevel / deboot.sh
Last active February 20, 2025 03:33
script to build Ubuntu rootfs (for arm64, armhf, powerpc, ppc64el)
#!/bin/bash
#
# deboot.sh
# script to build Ubuntu rootfs (for arm64, armhf, powerpc, ppc64el)
#
# Copyright 2017 knotdevel
# Released under the MIT license
# http://opensource.org/licenses/mit-license.php
#
#

notice: Wii U linux is not production ready! Proceed at your own risk. Written on 2/3/18

Quarktheawesome and rw-r-r_0644 have released an early version of Linux for Wii U!

Source code

The PowerPC side of the Wii U requires a custom linux kernel, which can be found here. The ARM side of the Wii U requires a custom fw.img file to load that kernel, which can be found here.

Once the kernel is up and running, the first repo is configured to automatically try to load programs from /dev/sda1 in an inserted usb. The first partition of an ext4 USB stick should contain a root filesystem for a linux distribution. See here for more information on a prebuilt PowerPC image

Notice