Skip to content

Instantly share code, notes, and snippets.

👨‍🚀
On the verge

Chigozirim C. smac89

👨‍🚀
On the verge
Block or report user

Report or block smac89

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@smac89
smac89 / README.md
Last active Feb 23, 2019
Updated script for installing Canon Printer drivers on Ubuntu
View README.md

##Canon MF632CDW Driver download

When using the script to install the drivers on Ubuntu, the script will tend to use yum and rpm to carry out the installation.

I find it strange that these package managers were installed on my system in the first place, but I did not remove them incase they are used for something important.

The changes made removes those checks for yum and rpm thus forcing the script to use the apt and deb for Debian systems such as Ubuntu and variants.

@smac89
smac89 / strace_zsh.log
Last active Dec 28, 2018
Trace of opening zsh in vscode
View strace_zsh.log
This file has been truncated, but you can view the full file.
execve("/bin/zsh", ["/bin/zsh"], 0x7ffd981fa0f0 /* 126 vars */) = 0
brk(NULL) = 0x561ce13fc000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=308693, ...}) = 0
mmap(NULL, 308693, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feb9b74b000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
@smac89
smac89 / StructuralSearch.md
Last active Aug 15, 2018
#IntelliJ #idea Structural search tips.
View StructuralSearch.md

Find field references on an instance

In this example, we want to find places where one did:

someClass.someField

Where someClass is of the type fully.qualified.SomeClass

Find and replace field reference with method call
@smac89
smac89 / PictureInstructions.md
Created Aug 7, 2018
Exporting libreoffice calc sheet as image #libreoffice #export #image
View PictureInstructions.md

We start with this spreadsheet:

screenshot from 2018-08-07 16-43-15

Next we select the range to export:

screenshot from 2018-08-07 16-44-11

Next we click File > Export:

@smac89
smac89 / Instructions.md
Last active Aug 2, 2018
Teamspeak server setup on Linux Ubuntu 16.04. #teamspeak #server #ts3
View Instructions.md

Downloading teamspeak

Since the server will likely not have a UI, so the download must be done with a command

The command to download teamspeak (Find the most recent version and download instead):

wget -O teamspeak-server.tar.bz2 http://dl.4players.de/ts/releases/3.0.13.8/teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2

Setting up teamspeak folder

@smac89
smac89 / SSHServerSetup.md
Created Jun 7, 2018
Set up an #ssh #server with public key encryption
View SSHServerSetup.md

Server

Create the user group and add the users you want to be part of this group:

sudo groupadd sshusers
sudo usermod -a -G sshusers <username>

Client

# Generate key and create password
@smac89
smac89 / recover.md
Last active May 30, 2018
Things to try when Gnome shell freezes or becomes unresponsive
View recover.md
View java_error_in_PYCHARM_11693.log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007ff2908189fa, pid=11693, tid=0x00007ff24cf43700
#
# JRE version: OpenJDK Runtime Environment (8.0_152-b11) (build 1.8.0_152-release-1024-b11)
# Java VM: OpenJDK 64-Bit Server VM (25.152-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# v ~BufferBlob::jni_fast_GetLongField
#
@smac89
smac89 / Main.java
Created Feb 5, 2018
Java sliding windows via Streams
View Main.java
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;
public class Main {
public static void main(String args[]) {
Stream<List<Integer>> stream = SlidingWindow.pagedStream(StreamableSupplier.fromStream(IntStream.range(1, 10000).boxed()), 5)
.apply(i -> i <= 100);
stream.forEach(System.out::println);
View data.json
[{"id":"1e1eed54-b77d-455f-80ee-d4e06080f080","first_name":"Marena","last_name":"Fladgate","email":"mfladgate0@go.com","gender":"Female","class_count":7},
{"id":"6cdf7502-1b73-49f6-a683-b40177252d92","first_name":"Wesley","last_name":"Champerlen","email":"wchamperlen1@multiply.com","gender":"Male","class_count":7},
{"id":"2dd8e4ec-b6bc-466f-86cc-ca4465950e09","first_name":"Olympie","last_name":"de Guerre","email":"odeguerre2@alibaba.com","gender":"Female","class_count":3},
{"id":"d3986688-e060-46fc-b890-40ff538487ce","first_name":"Alden","last_name":"Rossoni","email":"arossoni3@storify.com","gender":"Male","class_count":3},
{"id":"2e9ebdf3-dc9e-4cc9-afb7-9692164bb94a","first_name":"Ekaterina","last_name":"Danbury","email":"edanbury4@com.com","gender":"Female","class_count":7},
{"id":"04e282bf-06ff-45b7-a280-68c450586c8f","first_name":"Hillary","last_name":"Hanny","email":"hhanny5@dot.gov","gender":"Male","class_count":4},
{"id":"d9c64c60-ff4d-47c3-a15a-1a8273a70be3","first_name":"Osmond","last_name":"Stannisl
You can’t perform that action at this time.