Skip to content

Instantly share code, notes, and snippets.

View Sinofine's full-sized avatar

sinofine Sinofine

  • China
View GitHub Profile
@greyltc
greyltc / launch-GRD.sh
Last active May 25, 2024 01:06
configures then activates gnome-remote-desktop from the command line
#!/usr/bin/env bash
# run this on the remote terminal machine, as auser with sudo powers, probably through a remote ssh shell
# this will overwrite all the settings it touches
# the name of the user to run these commands as
TARGET_USER=jane
# we need an inlocked desktop session. we can either start a new autologin one or unlock an existing one
@mattdenner
mattdenner / README.markdown
Last active March 5, 2024 19:33
Suspend and then hibernate after 60 minutes

I found a post about suspending and then going into hibernate that included a really clever script. Turns out that with NixOS this is even esaier to coordinate as you have systemd so can have a before and after service. I just include this in my /etc/nixos/configuration.nix file and nixos-rebuild; then a systemctl suspend or a close of the lid will cause the hibernate timer to be set.

@shikil
shikil / ec.py
Created December 29, 2015 09:50
Elliptic curve
from sympy.abc import x, y
from sympy.core.compatibility import is_sequence
from sympy.core.numbers import oo
from sympy.core.relational import Eq
from sympy.polys.domains import FiniteField, QQ, RationalField
from sympy.solvers.solvers import solve
from sympy.ntheory.factor_ import divisors
from sympy.ntheory.residue_ntheory import sqrt_mod