Skip to content

Instantly share code, notes, and snippets.

View vdergachev's full-sized avatar
🏠
Working from home

Vladimir Dergachev vdergachev

🏠
Working from home
View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@vdergachev
vdergachev / github_bitbucket_multiple_ssh_keys.md
Created February 7, 2024 19:17 — forked from yinzara/github_bitbucket_multiple_ssh_keys.md
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@vdergachev
vdergachev / proxy_for_terminal.md
Created February 6, 2024 16:26 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@vdergachev
vdergachev / cisco-anyconnect-auto-login.md
Created February 6, 2024 13:28 — forked from zenglian/cisco-anyconnect-auto-login.md
auto login with cisco anyconnect (password saved, silent mode)

Cisco AnyConnect: auto login in silent mode

This gist is for Linux. For windows is the same thing.

Connect

create a file .login_info as below:

connect your.server.url    
usernanme 
# Turn off "Connected User Experiences and Telemetry" service
# Отключить службу "Функциональные возможности для подключенных пользователей и телеметрия"
Get-Service -Name DiagTrack | Stop-Service -Force
Get-Service -Name DiagTrack | Set-Service -StartupType Disabled
# Turn off per-user services
# Отключить пользовательские службы
$services = @(
# Contact Data
# Служба контактных данных
"PimIndexMaintenanceSvc_*"
// Filter list with O(n) and consume only O(1) additional space
public class RemoveKFromList {
ListNode<Integer> removeKFromList(ListNode<Integer> list, int k) {
ListNode<Integer> head = null;
for(ListNode<Integer> temp = list; list != null; list = list.next, temp.next = null){
if(list.value != k) {
if (head == null) {
head = new ListNode<>(list.value);
temp = head;
# According https://jfrog.com/knowledge-base/how-to-resolve-unable-to-find-valid-certification-path-to-requested-target-error/
# you should export artifactory certificate with following command
openssl s_client -showcerts -connect artifactory-host:port
# save it as root.crt and import with command
keytool -importcert -keystore "C:\jdk-13\lib\security\cacerts" -storepass changeit -file "C:\workspace\root.crt" -alias "artifactory-alias"
@vdergachev
vdergachev / get_wifi_pwd.cmd
Created September 7, 2019 11:35
Get password of knows WiFi netwok in Windows 10
netsh wlan show profile name=WifiSIDName key=clear
-- 1 вариант
WITH cl AS (
SELECT COALESCE(
SELECT client_id FROM client WHERE client.client_name = 'имя клиента',
INSERT INTO client (client_id, client_name) VALUES (nextval('client_seq'), 'имя клиента') RETURNING client_id
) as id
) INSERT INTO order (order_id, client_id, order_name)
VALUES (netxval('order_seq'), cl.id, 'имя заказа')
FROM cl;
C:\workspace\piga\pigallery2-master>npm run add-translation -- --ru
> pigallery2@1.5.6 add-translation C:\workspace\piga\pigallery2-master
> gulp add-translation "--ru"
[12:43:05] Using gulpfile C:\workspace\piga\pigallery2-master\gulpfile.js
[12:43:05] Starting 'add-translation'...
[12:43:05] Starting 'extract-locale'...
creating source translation file: locale.source.xlf