Skip to content

Instantly share code, notes, and snippets.

@carlkibler
carlkibler / sys_uptime.py
Created June 10, 2011 22:01
Retrieve system uptime with Python
import subprocess
def uptime():
raw = subprocess.check_output('uptime').replace(',','')
days = int(raw.split()[2])
if 'min' in raw:
hours = 0
minutes = int(raw[4])
else:
hours, minutes = map(int,raw.split()[4].split(':'))
@davidalexander
davidalexander / gist:1086455
Last active September 7, 2023 07:42
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@leek
leek / _Magento1_DeleteTestData.md
Last active December 29, 2023 09:51
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.

@arosenhagen
arosenhagen / magento-code-snippets.md
Last active April 8, 2024 09:21
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@willurd
willurd / web-servers.md
Last active July 6, 2024 23:56
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@neophit
neophit / Useful Keyboard Text Shortcuts.applescript
Last active July 7, 2019 12:01
Add useful keyboard text shortcuts for exponents and fractions to your System Preferences. With iCloud enabled, these shortcuts will sync with your iOS devices. Tested on OS X 10.9.1 and iOS 7.0.4. Requires GUI Scripting Access: http://support.apple.com/kb/HT5914 (Based partially on this script: https://gist.github.com/Zettt/7724258)
set clickDelay to 0.3
set textReplaceList to {}
set exponentsListName to "Exponents (replaces ^0-^9 with ⁰-⁹)"
set fractionsListName to "Fractions (replaces 1/2-7/8 with ½-⅞)"
set exponentsList to {{"^0", "⁰"}, {"^1", "¹"}, {"^2", "²"}, {"^3", "³"}, {"^4", "⁴"}, {"^5", "⁵"}, {"^6", "⁶"}, {"^7", "⁷"}, {"^8", "⁸"}, {"^9", "⁹"}}
set fractionsList to {{"1/2", "½"}, {"1/3", "⅓"}, {"1/4", "¼"}, {"1/5", "⅕"}, {"1/6", "⅙"}, {"1/7", "⅐"}, {"1/8", "⅛"}, {"1/9", "⅑"}, {"1/10", "⅒"}, {"2/3", "⅔"}, {"2/5", "⅖"}, {"3/4", "¾"}, {"3/5", "⅗"}, {"3/8", "⅜"}, {"4/5", "⅘"}, {"5/6", "⅚"}, {"5/8", "⅝"}, {"7/8", "⅞"}}
set chosenLists to (choose from list {exponentsListName, fractionsListName} with title "Useful Keyboard Text Shortcuts" with prompt "Choose one or more sets of keyboard text shortcuts to add to your System Preferences.
This may take a minute to complete." OK button name "Add text shortcuts" cancel button name "Cancel" default items {exponentsListName, fractionsListName} with multiple selections allowed)
@InQuize
InQuize / Proxomox - NUT Client.md
Last active June 16, 2024 22:07
Proxomox - NUT Client.md
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@sumonchai
sumonchai / move_syno_pkgs.sh
Created May 17, 2019 15:22 — forked from nobodypb/move_syno_pkgs.sh
Script for moving packages on a synology disk station from one volume to another - EXPERIMENTAL!
#!/bin/bash
SOURCE=/volume1
DEST=/volume2
APPDIR=\@appstore
ASK=true
while getopts ":y" opt; do
case $opt in
@stek29
stek29 / dreame_1c_root.md
Last active March 2, 2024 12:38
Root Dreame Robot without via uart only

These are just my notes, and described process worked for me on my 1C robot
If anything goes wrong, having USB adapter for FEL flashing might be the only way to restore your robot
this is not an official guide
oh, and I'm not responsible for any damage blah blah
and huge thanks to Dennis and Hypfer, and everyone behind this root :)

0. get uboot shell

to enter uboot shell on 1C you have to: 0. turn robot off normally

  1. hook up uart, open console