Skip to content

Instantly share code, notes, and snippets.

@mickys
mickys / Deploy
Created April 5, 2021 12:17 — forked from javiergloria/Deploy
How to automatically deploy from GitHub
# Deploy your site with git
This gist assumes:
* you have an online remote repository (github / bitbucket etc.)
* you have a local git repo
* and a cloud server (Rackspace cloud / Amazon EC2 etc)
* your (PHP) scripts are served from /var/www/html/
* your webpages are executed by Apache
* the Apache user is named `www-data` (may be `apache` on other systems)
// Here You can type your custom JavaScript...
const seasonWords = [
"Season",
"S0",
"S1",
"S2",
"S3",
"S4",
@mickys
mickys / boot-grub2-grub.cfg
Created June 11, 2019 19:26
grub menu list
[root@Fedora-30]# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
@mickys
mickys / proc_memory_dump.py
Created June 10, 2019 15:33
proc_memory_dump.py
#! /usr/bin/env python
import re
maps_file = open("/proc/3778/maps", 'r')
mem_file = open("/proc/3778/mem", 'r', 0)
for line in maps_file.readlines(): # for each mapped region
m = re.match(r'([0-9A-Fa-f]+)-([0-9A-Fa-f]+) ([-r])', line)
if m.group(3) == 'r': # if this is a readable region
start = int(m.group(1), 16)
end = int(m.group(2), 16)
mem_file.seek(start) # seek to region start
Running a modified ( for logging ) fork of https://github.com/AMDESE/linux/tree/sev-es-4.19
/lib/firmware/amd/amd_sev_fam17h_model0xh.sbin
firmware versions 0.17 - build 11 ( from latest kernel )
firmware versions 0.17 - build 22 ( from developer.amd.com )
Both result in "Failed to update SEV firmware: 0x8003"
[ 9.774804] ccp 0000:65:00.1: enabled
@mickys
mickys / base_test.sol
Created May 6, 2019 16:40
Careful when you override / redeclare the same variable in a child contract
pragma solidity ^0.5.0;
contract Base {
string name = "Parent Name";
constructor() public {
}
@mickys
mickys / zilliqatx.ts
Last active September 27, 2018 10:28
const BN = require( 'bn.js' );
import { util as OfficialUtil } from 'zilliqa-js';
import { Zilliqa } from 'zilliqa-js';
const zilliqa = new Zilliqa({
nodeUrl: 'http://localhost:4200',
});
const privateKey = "db11cfa086b92497c8ed5a4cc6edb3a5bfe3a640c43ffb9fc6aa0873c56f2ee3";
const myCode = "";
pragma solidity ^0.4.17;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
@mickys
mickys / Replicator.sol
Created April 18, 2018 14:22
Replicating Solidity Contract
pragma solidity ^0.4.22;
// @mickys - based on https://gist.github.com/holiman/069de8d056a531575d2b786df3345665
contract Replicator {
address public parent;
function replicate() public returns(address) {
address childAddress = clone(address(this));
Replicator child = Replicator(childAddress);
child.setParent(address(this));
@mickys
mickys / gist:24d837b1a2bd0d149f6b61704b634ea0
Created January 31, 2018 22:37
BlockBits Contract Flattened
pragma solidity ^0.4.17;
contract TokenSCADAVariable {
Funding FundingEntity;
bool public SCADA_requires_hard_cap = true;
function TokenSCADAVariable( address _fundingContract ) public {