Skip to content

Instantly share code, notes, and snippets.

View jubnzv's full-sized avatar

Georgiy Komarov jubnzv

View GitHub Profile
@jubnzv
jubnzv / sig_sync.c
Last active December 9, 2018 09:10
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#!/usr/bin/env python3
#
# Usage example:
#
# echo "hello\nworld" > words.txt
# ./dict_generator.py > dict.md
# pandoc -s dict.md -o dict.doc
#
import bs4
import time
@jubnzv
jubnzv / drestivo-org-download-method.el
Created January 20, 2019 10:10 — forked from daviderestivo/drestivo-org-download-method.el
This is an helper function for org-download. It creates an \"./image\" folder within the same directory of the org file. Images are separated inside that image folder by additional folders one per org file.
(defun drestivo/org-download-method (link)
"This is an helper function for org-download.
It creates an \"./image\" folder within the same directory of the org file.
Images are separated inside that image folder by additional folders one per
org file.
More info can be found here: https://github.com/abo-abo/org-download/issues/40.
See the commit message for an example:
https://github.com/abo-abo/org-download/commit/137c3d2aa083283a3fc853f9ecbbc03039bf397b"
(let ((filename
(file-name-nondirectory
@jubnzv
jubnzv / Build Emacs for Windows 64bit.md
Created February 16, 2019 14:14 — forked from nauhygon/Build Emacs for Windows 64bit with Native Compilation.md
Step-by-step instructions to build Emacs for Windows 64 bit with MSYS2 and MinGW-w64.

Build Emacs-w64 with MSYS2/MinGW-w64

Instructions are modified from emacs-w64 Wiki page by zklhp. Many thanks for sharing!

  1. Download MSYS2 (msys2-x86_64-20161025.exe) from this download page.

  2. Install MSYS2 to, for example, C:\msys2 (make sure no space in path).

  3. Optionally prettify the MSYS2 console mintty with ~/.minttyrc to make it more pleasing to eyes. Thanks to this awesome theme!

call plug#begin('~/.local/share/nvim/plugged')
Plug 'liuchengxu/vista.vim'
Plug 'itchyny/lightline.vim'
call plug#end()
let g:lightline = {
\ 'colorscheme': 'gruvbox',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'readonly', 'filename', 'modified' ],
cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check.
app/src/controllers/shortcutSettings/ShortcutSettingsController.cpp:7:29: warning: Member variable 'ShortcutSettingsController::view' is not initialized in the constructor. [uninitMemberVar]
ShortcutSettingsController::ShortcutSettingsController(QObject *parent) : QObject(parent)
^
app/src/controllers/shortcutSettings/ShortcutSettingsController.cpp:7:29: warning: Member variable 'ShortcutSettingsController::model' is not initialized in the constructor. [uninitMemberVar]
ShortcutSettingsController::ShortcutSettingsController(QObject *parent) : QObject(parent)
^
app/src/libraries/ClipboardBranch.cpp:104:42: performance: Function parameter 'parent_id' should be passed by const reference. [passedByValue]
void ClipboardBranch::addBranch( QString parent_id, QMap<QString, QString> branch_fields)
^
@jubnzv
jubnzv / CoreFreq crash
Created December 2, 2019 20:51
cppcheck -j4 --template=daca2 language=c --addon=misra.py --addon=cert.py
Checking /home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-extra.c ...
Checking /home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-json.c ...
Checking /home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-rsc.c ...
Checking /home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli.c ...
/home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-extra.h:19:12: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-2.7]
/home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-extra.h:28:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-2.7]
/home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-extra.c:1:1: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-3.1]
/home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/corefreq-cli-extra.c:45:1: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-3.1]
/home/jubnzv/Dev/check-sandbox/sandbox/CoreFreq/core
@jubnzv
jubnzv / 1.c
Created December 5, 2019 05:18
tokenizer-str-1.89
int main(int argc, char const* argv[])
{
int i = 1, j = 0;
return 0;
}
Rule 12.3: https://github.com/oneoo/alilua/blob/master/deps/yac/yac_storage.c#L288
Rule 12.3: https://github.com/oneoo/alilua/blob/master/src/network.c#L304
Rule 12.3: https://github.com/oneoo/alilua/blob/master/src/worker.c#L272
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/attic/swig/apriori_wrap.c#L433
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/attic/swig/swig2/intexp_wrap.c#L458
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/ext/apriori/src/apriori.c#L440
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/ext/apriori/src/apriori.c#L449
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/ext/apriori/src/apriori.c#L455
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/ext/apriori/src/apriori.c#L456
Rule 12.3: https://github.com/jashmenn/apriori/blob/master/ext/apriori/src/apriori.c#L465
1. connect to host localhost port 22: Connection refused
Stopping namenodes on [localhost]
localhost: ssh: connect to host localhost port 22: Connection refused
localhost: ssh: connect to host localhost port 22: Connection refused
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: ssh: connect to host 0.0.0.0 port 22: Connection refused
Fix:
thanooj@ubuntu:/$ sudo apt-get install openssh-server
Reading package lists... Done