Skip to content

Instantly share code, notes, and snippets.

@mxamin
mxamin / ibsng_update_custom_field.md
Created August 15, 2018 05:56
IBSng - Update User's Custom Field Value

IBSng - Update User's Custom Field Value

Suppose we already created a custom field named company for users, now we want to update this attribute for user with user_id 15 with parspooyesh value. In this scenario we have already authenticated with IBSng:

  • client IP address: 192.168.1.101
  • IBSng WS server and port: 192.168.1.104:1237
  • auth_name: system
  • auth_session: w6ig5hwv1ohv
$ curl -H "Content-Type: application/json" \
 -H "Accept: application/json" \
@mortymacs
mortymacs / openldap-get-changed-users.md
Created November 11, 2017 12:28
How to get OpenLdap user changed attributes instead of all user attributes

To handle this issue, you need to get openldap internal fields by adding a + sign at the end of search query like so:

    $ ldapsearch -h localhost -w 'admin' -x -D "cn=admin,dc=example,dc=org" -b "DC=example,DC=org" +

And in python code it would like this:

    r = l.search_ext("dc=example,dc=org", ldap.SCOPE_SUBTREE, "objectClass=*", ["+",], 0)
@morteza-mori
morteza-mori / pyhton
Created November 5, 2017 05:53
pyhton web service
python -m SimpleHTTPServer
python -m SimpleHTTPServer 9000
@mortymacs
mortymacs / docker-useful-commands.md
Created September 2, 2017 06:10
Docker Some Useful Commands

Backup From Container

$ docker export myproject-dev > myproject-dev.tar

Import Backuped Container

$ docker import myproject-container.tar

List of Images

@mortymacs
mortymacs / proxy-jump-ssh-connection.md
Last active March 28, 2018 01:53
Proxy Jump in SSH Connections

Create config file for ssh (my.conf):

Host Server1
    User root
    HostName 192.168.100.10
Host Server2
    User root
    HostName 192.168.100.5
Host Server3
 User root
@mortymacs
mortymacs / vbox-cli-manual.md
Last active February 21, 2018 07:40
VirtualBox Useful Commands

Create vm

VBoxManage createvm --name "Debian 9" --register

Modify vm

VBoxManage modifyvm "Debian 9" --memory 1024
@mortymacs
mortymacs / manual.md
Created July 19, 2017 19:57
Set Proxy On Docker Service in Linux
  • First install tor and privoxy and config them.
  • Create a file in this directory with below config: touch /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=127.0.0.1:8118"
@tsaqib
tsaqib / install-docker-deb8.sh
Last active May 23, 2018 06:17
Docker installer script for Debian 8 Jessie
# Docker installation script for Debian 8 Jessie on Azure
# Usage: execute sudo -i, first.
# wget -q -O - "$@" https://gist.githubusercontent.com/tsaqib/b2c83ac30f962ab78a5472902c325aa9/raw/ --no-cache | sh
# After running the script reboot and check whether docker is running.
apt-get purge lxc-docker*
apt-get purge docker.io*
apt-get update -y && sudo apt-get upgrade -y
apt-get install -y apt-transport-https ca-certificates
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 12, 2024 17:44
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@willurd
willurd / web-servers.md
Last active April 18, 2024 14:15
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000