Skip to content

Instantly share code, notes, and snippets.

View lopesivan's full-sized avatar
🚧
Working from home

Mr. Ivan lopesivan

🚧
Working from home
View GitHub Profile
@lopesivan
lopesivan / create-hotspot.md
Created October 30, 2018 07:33 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@lopesivan
lopesivan / templight_root_profile.sh
Created October 12, 2018 00:24 — forked from eguiraud/templight_root_profile.sh
use templight to compile a root source and produce parsed profile info
#!/bin/bash
# N.B. requires gawk, recode, templight++ and templigt-convert to be in PATH
SRC="$1"
if [[ -z "${SRC}" ]]; then
exit 1
fi
FNAME=${SRC%.C}
FNAME=${FNAME%.cpp}
@lopesivan
lopesivan / create-package.md
Created June 14, 2018 06:46 — forked from deanrather/create-package.md
Creating a .deb Package

Creating a .deb Package

This creates a package which runs an install.sh which copies a file somewhere the below is entirely incorrect. Hopefully I'll get around to fixing it tip: this would install to the root dir & the relative path to ./install.sh would be wrong

go to project directory

cd /path/to/project
@lopesivan
lopesivan / gnome-terminal-profiles.adoc
Created May 24, 2018 09:01
Export / Import Gnome Terminal Profiles

Export Gnome Terminal Profile

List profiles

dconf dump /org/gnome/terminal/legacy/profiles:/

Determine the terminal profile string for the profile you will need. This is the terminal profile that I will export:

@lopesivan
lopesivan / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created March 6, 2018 04:13 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@lopesivan
lopesivan / CMakeLists.txt
Created December 9, 2017 00:41 — forked from bellbind/CMakeLists.txt
[c] malloc and free implementation on the static memory pool
# How to build and to run
# mkdir build ; cd build/ ; cmake .. ; make ; ./test
# (cleanup: rm -r build/)
set(CMAKE_C_STANDARD 11)
list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic")
add_library(mymalloc SHARED mymalloc.c)
add_executable(test test.c)
link_directories(.)
target_link_libraries(test mymalloc)
@lopesivan
lopesivan / books.py
Created December 8, 2017 12:48 — forked from kennethlove/books.py
Smarter book object.
class Book:
title = ''
pages = 0
def __init__(self, title='', pages=0):
self.title = title
self.pages = pages
def __add__(self, other):
"""Control adding two Books together or a Book and a number"""
@lopesivan
lopesivan / README.md
Created October 24, 2017 22:50 — forked from magnetikonline/README.md
Install VirtualBox 5.1 guest additions on Ubuntu server guest.

Install VirtualBox 5.1 guest additions on Ubuntu server guest

Have tested these instructions successfully under an Ubuntu 16.04LTS guest:

  • Create Ubuntu server instance under VirtualBox (obviously).

  • Start VM, goto Devices - Insert Guest Additions CD image to mount the ISO image.

  • From the terminal, run the following commands:

     $ sudo su
     $ apt install gcc make
@lopesivan
lopesivan / gist:da491683b9abf95d71cae193f5aea48e
Created October 16, 2017 13:27 — forked from tokolist/gist:5387210
AVR Microcontroller Hello World (LED Blink) http://youtu.be/smsW95zcFfE
#define F_CPU 1000000 //1MHz
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRC |= (1<<DDC5); // set LED pin PC5 to output
while(1)
{
@lopesivan
lopesivan / gist:bee47a4130a705041949df922ee4d619
Created October 16, 2017 13:26 — forked from tokolist/gist:5430888
AVR Microcontroller Advanced Hello World (LED Blink) http://youtu.be/KatkY_YJgsY
#define F_CPU 16000000 //16MHz
#include <avr/io.h>
#include <util/delay.h>
int ledPins[] = {PC3, PC4, PC5};
int ledPinsNum = sizeof(ledPins)/sizeof(int);
bool pressed = false;
bool oldPressed = false;