Skip to content

Instantly share code, notes, and snippets.

View jgomezdans's full-sized avatar

José Gómez-Dans jgomezdans

View GitHub Profile
@SydoxX
SydoxX / forti-fix.sh
Last active February 19, 2024 12:51
Fixes Forticlient 7.0.7
#!/bin/bash
# version 2 thanks to @dhx-mike-palandra
echo "Creating /etc/NetworkManager/conf.d/99-forticlient.conf..."
sudo cat > /etc/NetworkManager/conf.d/99-forticlient.conf << 'EOF'
[keyfile]
unmanaged-devices=interface-name:~vpn*,type:tun
EOF
if [ $? -eq 0 ]
@adam-binks
adam-binks / latexdiff.md
Created May 7, 2022 17:18
How to LaTeX diff your Overleaf project

How to LaTeX diff your Overleaf project

Set up local latex environment

Grab the two versions

  • Download the original version
    • Go to Overleaf > history > find the version > view single version > download project at this version
  • Download the current version
@braunfuss
braunfuss / snappy_proc.py
Last active July 15, 2022 20:13
Sentinel-1 processing with snappy (snaps python api) for one swath (https://step.esa.int/main/toolboxes/snap/)
import os
import snappy
from snappy import GPF
from snappy import ProductIO
from snappy import HashMap
from snappy import jpy
import subprocess
from time import *
# documentation: http://step.esa.int/docs/v2.0/apidoc/engine/overview-summary.html
# See https://www.anaconda.com/understanding-and-improving-condas-performance/ for more info.
# help debug channel issues
show_channel_urls: true
# pip will always be installed with python
add_pip_as_python_dependency: true
# strict priority and conda-forge at the top will ensure
# that all of your packages will be from conda-forge unless they only exist on defaults
@goerz
goerz / revtex.tplx
Last active February 22, 2021 09:33
custom jupyter nbconvert latex template, using revtex
((*- extends 'article.tplx' -*))
% See http://blog.juliusschulz.de/blog/ultimate-ipython-notebook#templates
% for some useful tips
%===============================================================================
% Document class
%===============================================================================
((* block docclass *))
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active January 22, 2024 11:18
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@paolo-losi
paolo-losi / openopt_svm.py
Created September 28, 2012 13:24
OpenOpt SVM
import numpy as np
import FuncDesigner as fd
from openopt import NLP
from sklearn.metrics.pairwise import rbf_kernel, polynomial_kernel
def theta(x):
return 0.5 * (fd.sign(x) + 1.)
@teoliphant
teoliphant / life.py
Created August 14, 2012 22:03
Array-oriented version of the game of life
from numpy.random import rand
from numpy import r_, ix_, uint8, roll
import matplotlib.pyplot as plt
import time
size = 200
GRID = (rand(size,size) > 0.75).astype(uint8)
# Rotate indices because the world is round
indx = r_[0:size]
up = roll(indx, -1)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jiahao
jiahao / Optimizer.py
Created January 4, 2012 17:44
Pure Python implementation of some numerical optimizers
#!/usr/bin/env python
'''
Pure Python implementation of some numerical optimizers
Created on Jan 21, 2011
@author Jiahao Chen
'''