Skip to content

Instantly share code, notes, and snippets.

View zz's full-sized avatar
💭
I may be slow to respond.

ZZ zz

💭
I may be slow to respond.
  • Japan
View GitHub Profile
/usr/bin/launchctl unload "/Applications/Falcon.app/Contents/Library/SystemExtensions/com.crowdstrike.falcon.Agent.systemextension",
/usr/bin/launchctl unload "/Library/LaunchAgents/com.crowdstrike.falcon.UserAgent.plist",
/usr/bin/killall -9 "/Applications/Falcon.app/Contents/Library/LaunchServices/Falcon Notifications.app/Contents/MacOS/Falcon Notifications",
/sbin/kextunload -b "/Applications/Falcon.app/Contents/Extensions/Agent.kext"
/bin/rm -r "/Applications/Falcon.app"
/bin/rm "/Library/LaunchAgents/com.crowdstrike.falcon.UserAgent.plist"
/usr/local/bin/jamf recon
@zz
zz / DetectScroll.vue
Last active July 26, 2021 18:43 — forked from aschmelyun/DetectScroll.vue
Detect scrolling to the bottom of a div in Vue.js
<template>
<div class="wrapper">
<div class="box" @scroll="handleScroll">
<p>Your content here...</p>
</div>
<a href="#" v-if="hasScrolledToBottom">Show After Scrolling</a>
</div>
</template>
<script>
export default {
@zz
zz / nginx.conf
Created December 1, 2019 16:31 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@zz
zz / read-access.sql
Created July 24, 2019 08:03 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@zz
zz / mac-vagrant-howto.rst
Created April 22, 2019 04:51 — forked from tbonesteaks/mac-vagrant-howto.rst
brew, vagrant, virtualbox, and vagrant file howto...

Vagrant on Mac w Virtualbox

NSoT engineers have built Vagrantfiles for you to deploy NSoT software in a multitude of linux environments. This tutorial will help you load a Macintonsh computer (OS X) with Vagrant, Virtual Box, and dependencies so that you can start virtual servers and test the software.

NSoT publishes complete installation instructions for linux distributions, branch versions, and Vagrantfiles in addition to, not an alternative for the pip install method:

$ pip-install nsot
@zz
zz / revert-a-commit.md
Created December 6, 2018 02:35 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@zz
zz / http-proxy.go
Created October 25, 2018 06:58 — forked from fabrizioc1/http-proxy.go
Http proxy server in Go
package main
import (
"fmt"
"io"
"log"
"net/http"
)
type HttpConnection struct {
@zz
zz / alexa.js
Created July 15, 2018 09:18 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@zz
zz / http_get_request.go
Created March 13, 2018 16:02
golang http post request
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/url"
)