Skip to content

Instantly share code, notes, and snippets.

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

LwjiVD2t Lwjivd

💭
I may be slow to respond.
View GitHub Profile
@Lwjivd
Lwjivd / agent loop
Created March 14, 2025 07:10 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@Lwjivd
Lwjivd / README.md
Created January 8, 2024 03:27 — forked from zoilomora/README.md
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@Lwjivd
Lwjivd / server.py
Created October 13, 2021 02:03 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@Lwjivd
Lwjivd / uninstall_vmware.sh
Created June 10, 2020 13:36
Completely uninstall VMWare on macOS
#!/usr/bin/env bash
# Usage: bash uninstall_vmware.bash
remove() {
entry="$1"
echo -ne "Removing $entry ["
sudo rm -rf "$entry"
if [[ ! -e "$entry" ]]; then
echo -ne "OK"
@Lwjivd
Lwjivd / curl_to_request.py
Created June 3, 2020 13:45
convert cURL to python requests
Ultimate Software
People First.
View all 7 job openings!
15
3
I'm trying to convert the following working request in curl to a python request (using the Requests http://docs.python-requests.org/en/v0.10.7/).
# -*- coding: utf-8 -*-
import os
import subprocess
import logging
import multiprocessing
import shutil
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
@Lwjivd
Lwjivd / timecapsule-handler
Created May 3, 2016 11:33 — forked from dgraziotin/timecapsule-handler
Script to automatically look for Apple TimeCapsule devices and mount/umount them under GNU/Linux. See http://task3.cc/418/how-to-automatically-mount-and-umount-apple-time-capsule-on-linu for info and explanations.
#!/bin/bash
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
#
# Version 3, enhanced for Ubuntu 13.X+, Fedora 19+, and similar distros.
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@Lwjivd
Lwjivd / database.py
Created February 10, 2014 02:06
Pthon MySQLdb
import MySQLdb as mysql
import MySQLdb.cursors
class Database:
connection = None
get_shows_query = "SELECT tvdb_id, show_name, popularity FROM shows ORDER BY show_name;"
get_show_query = "SELECT * FROM shows WHERE tvdb_id=%s LIMIT 1;"
get_show_episodes_query = ("SELECT tvdb_episode_id, season_number, episode_number, episode_name, episodes.summary, image, DATE_FORMAT(air_date, '%%Y-%%m-%%d') AS air_date"
" FROM episodes"
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),