Skip to content

Instantly share code, notes, and snippets.

View YSaxon's full-sized avatar

Yaakov Saxon YSaxon

View GitHub Profile
@gigorok
gigorok / gist:5ca39384635113495796
Created July 4, 2014 13:59
php interactive shell with loaded composer dependencies
php -a -d auto_prepend_file=./vendor/autoload.php
@azizur
azizur / Creating a static copy of a dynamic website.md
Last active November 7, 2024 17:32
Creating a static copy of a dynamic website

The command line, in short…

wget -k -K -E -r -l 10 -p -N -F --restrict-file-names=windows -nH http://website.com/

…and the options explained

  • -k : convert links to relative
  • -K : keep an original versions of files without the conversions made by wget
  • -E : rename html files to .html (if they don’t already have an htm(l) extension)
  • -r : recursive… of course we want to make a recursive copy
  • -l 10 : the maximum level of recursion. if you have a really big website you may need to put a higher number, but 10 levels should be enough.
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active November 11, 2024 14:18
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@Benoss
Benoss / 00-usage.md
Created November 9, 2018 02:45
AutoSSH Tunnel Config

Create a new local tunnel user to keep the .ssh/config clean

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh  # and copy your private key here
sudo -u tunnel nano ~tunnel/.ssh/config  # add host and key configs here and a myhostsshconf (or other name)
sudo -u tunnel ssh myhostsshconf  # just make sure to add your host to `known_hosts`

Create a new systemd service with the same name than an entry in the .ssh/config (myhostsshconf in this example)

@FrankSpierings
FrankSpierings / frida.py
Created March 24, 2019 13:05
Ghidra Plugin - Generate Frida Hooks - Requires Oneshot Decompiler Parameter ID
#TODO write a description for this script
#@author
#@category _NEW_
#@keybinding
#@menupath
#@toolbar
#TODO Add User Code Here
def getFunctions():
@cwade
cwade / sql_server_from_python.md
Last active June 23, 2024 22:38
Using Python to connect to a Microsoft SQL Server database from OS X using Windows authentication

There are many instructions out there on how to do this, but none quite worked for me. I'm currently on a Mac running OS X Mojave (10.14.4)

These instructions got me closest, but I still couldn't get the python part of the equation to work.

Here's what worked for me.

First, install unixodbc using Homebrew. I highly recommend using Homebrew here because it's a little more complicated to install on its own.

brew install unixodbc
@svet-b
svet-b / ext4_mac_docker.md
Created May 10, 2021 19:33
Mount and edit SD card image with ext4 partitions on Mac using Docker

Go to the directory with the image you want to work with. Run a Docker container with that directory mounted:

docker run -it --privileged -v /dev:/dev -v (pwd):/tmp --workdir /tmp ubuntu bash

(replace (pwd) with "$PWD" if using bash instead of fish)

See this thread for an explanation of why --privileged and -v /dev:/dev are required. The need for the latter can be avoided with this alrternative workaround.

In the container, assuming that $IMAGE_FILE is the name of your image file:

from langchain.llms import Anthropic
from langchain.agents import load_tools, initialize_agent
from langchain.tools import AIPluginTool
PREFIX = """\n\nHuman: Answer the following questions as best you can. You have access to the following tools:"""
SUFFIX = """Begin!
Question: {input}
\n\nAssistant:
Thought:{agent_scratchpad}"""