Skip to content

Instantly share code, notes, and snippets.

View galois17's full-sized avatar

Khem galois17

View GitHub Profile
@galois17
galois17 / gist:ba17753b48f0e29c6afa6efd04dddb27
Created October 14, 2022 21:50
Check Jupyter kernel mapping
import os
from jupyter_client import kernelspec
kernel_name = '<kernel_name>'
spec = kernelspec.get_kernel_spec(kernel_name)
print(spec.resource_dir)
json_name = 'kernel.json'
full_path = os.path.join(spec.resource_dir, json_name)
@galois17
galois17 / stdc++.h
Created April 1, 2020 21:52
stdc++.h that is often seen in competitive programming posts
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
#!/usr/bin/env python3
# Copyright (c) 2017 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@galois17
galois17 / gist:4ce6bd8f7121d277ad81
Created May 20, 2015 13:05
Ubuntu upgrade issue with error
Resolved with:
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall python-minimal python-lockfile
(Reading database ... 31238 files and directories currently installed.)
Preparing to replace libssl1.0.0 1.0.1-4ubuntu5.25 (using .../libssl1.0.0_1.0.1-4ubuntu5.27_i386.deb) ...
Unpacking replacement libssl1.0.0 ...
Setting up libssl1.0.0 (1.0.1-4ubuntu5.27) ...
Processing triggers for libc-bin ...
@galois17
galois17 / gist:7919429
Created December 11, 2013 22:14
Delete blank lines
sed "/^[[:space:]]*$/d" orig.txt > target.txt
@galois17
galois17 / gitolite
Created July 9, 2012 13:41
Gitolite permission issue with gitweb
Edit .gitolite.rc and set
$REPO_UMASK = 0027;