Skip to content

Instantly share code, notes, and snippets.

View cocoaaa's full-sized avatar

Hayley Song cocoaaa

View GitHub Profile
@jasmas
jasmas / acdisable
Created January 26, 2022 17:29
Enable/Disable Cisco AnyConnect Socket Filter Extension on MacOS
#!/bin/sh
echo Disabling vpnagentd...
sudo launchctl disable system/com.cisco.anyconnect.vpnagentd
echo Tearing down vpnagentd...
sudo launchctl bootout system /Library/LaunchDaemons/com.cisco.anyconnect.vpnagentd.plist
echo Deactivating Cisco AnyConnect Socket Filter Extension...
/Applications/Cisco/Cisco\ AnyConnect\ Socket\ Filter.app/Contents/MacOS/Cisco\ AnyConnect\ Socket\ Filter -deactivateExt
@iamkirkbater
iamkirkbater / obs_virtual_camera.applescript
Last active December 8, 2023 22:07
Launches OBS, starts the virtual camera, and then minimizes the window.
on run {input, parameters} -- remove this line if running in Script Editor and not with Automator
tell application "OBS" to activate
tell application "System Events"
tell process "OBS"
set frontmost to true
if name of every menu item of menu "Tools" of menu bar 1 contains "Start Virtual Camera" then
click menu item "Start Virtual Camera" of menu "Tools" of menu bar 1
end if
click (first button of window 1 whose role description is "minimize button")
end tell
#%% IMPORTS
import torch
import pytorch_lightning as pl
import matplotlib.pyplot as plt
from pytorch_lightning import Trainer
from torch.nn import functional as F
import pyro
import pyro.distributions as dist
# %%
@schmmd
schmmd / slurm-gpu-stats.py
Created November 20, 2019 19:08
Slurm GPU Stats
#!/usr/bin/env python
import os
import re
import subprocess
import socket
import sys
def pids_of_jid(jid):
result = subprocess.run(["sstat", "-p", "--format=PID", "-j", jid, "--noheader"], stdout=subprocess.PIPE)
@endolith
endolith / DFT_ANN.py
Last active July 21, 2024 13:05
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000
@dakridas
dakridas / probability-vs-statistical-model.md
Created April 28, 2017 18:42
Probability vs Statistical model
@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
@dufferzafar
dufferzafar / GATE Related Stuff.txt
Last active January 11, 2024 10:38
GATE Stuff: Textbooks and Notes I've collected from various places on the internet.
@ezeeyahoo
ezeeyahoo / perfectelementary.bash
Last active May 1, 2023 07:53 — forked from v-thomp4/perfectelementary.bash
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#https://elementary.io/
#Clean-up System
sudo apt-get purge midori-granite -y
sudo apt-get purge yelp -y
sudo apt-get purge evince -y
sudo apt-get purge gnome-orca -y
sudo apt-get autoremove -y
sudo apt-get autoclean -y
@Newmu
Newmu / simple_gan.py
Created July 10, 2015 20:39
Simple Generative Adversarial Network Demo
import os
import numpy as np
from matplotlib import pyplot as plt
from time import time
from foxhound import activations
from foxhound import updates
from foxhound import inits
from foxhound.theano_utils import floatX, sharedX