Archive

Archives pour la catégorie ‘Système’

How-To Factory Reset MacBook Air and other macs with macOS

21/11/2017 Aucun commentaire

There are many reasons why you’d want to reset your MacBook Air to factory settings. Perhaps your Mac is showing just a too much little lag. Maybe you want to reset for better overall performance, are thinking of giving away or selling your MacBook after you purchase or receive the latest Mac model. For whatever reason, you need to set your Mac back to its factory defaults.

 

Since our Macs hold so much of our personal and private data, it’s imperative to clean out our machines when selling or giving away our favorite older Macs. And it’s particularly useful for the new user to have a nice clean machine that’s returned to its native factory state.

 

Lire la suite…

Print Friendly, PDF & Email
Categories: Système Tags: , ,

Where to Set Environment Variables in Mac OS X

20/11/2017 Aucun commentaire

At the command line, environmental variables are defined for the current shell and become inherited by any running command or process. They can determine anything from the default shell, the PATH, the users home directory, to the terminal emulation type, current working directory, where a history file is located, language and localization settings, and going further to include shell variables, which include everything from customizations to the bash prompt, colorized ls output, and changes to terminal appearance, to aliases, and much more.

 

Let’s walk through how to list environment and shell variables, and then how to set and add new environment variables at the command line of Mac OS X.

Displaying Current Environment & Shell Variables in Mac OS X

To quickly get a list of environmental variables, you can use the following command:

printenv

If you want to see a complete list of shell variables, the ‘set’ command can be issued as well:

set

The output of these commands can be lengthy so you may wish to pipe the output through the less or more commands.
Lire la suite…

Print Friendly, PDF & Email
Categories: Système Tags: , ,

How To Use Apache JMeter To Perform Load Testing on a Web Server

12/11/2017 Aucun commentaire

Introduction

In this tutorial, we will go over how to use Apache JMeter to perform basic load and stress testing on your web application environment. We will show you how to use the graphical user interface to build a test plan and to run tests against a web server.

JMeter is an open source desktop Java application that is designed to load test and measure performance. It can be used to simulate loads of various scenarios and output performance data in several ways, including CSV and XML files, and graphs. Because it is 100% Java, it is available on every OS that supports Java 6 or later.

 

Prerequisites

In order to follow this tutorial, you will need to have a computer that you can run JMeter on, and a web server to load test against. Do not run these tests against your production servers unless you know they can handle the load, or you may negatively impact your server’s performance.

You may adapt the tests in this tutorial to any of your own web applications. The web server that we are testing against as an example is a 1 CPU / 512 MB VPS running WordPress on a LEMP Stack, in the NYC2 DigitalOcean Datacenter. The JMeter computer is running in the DigitalOcean office in NYC (which is related to the latency of our tests).

Please note that the JMeter test results can be skewed by a variety of factors, including the system resources (CPU and RAM) available to JMeter and the network between JMeter and the web server being tested. The size of the load that JMeter can generate without skewing the results can be increased by running the tests in the non-graphical mode or by distributing the load generation to multiple JMeter servers.  Lire la suite…

Print Friendly, PDF & Email

How To Improve Database Searches with Full-Text Search in MySQL 5.6 on Ubuntu 16.04

05/11/2017 Comments off

Introduction

Full-text search, or FTS, is a technique used by search engines to find results in a database. You can use it to power search results on websites like shops, search engines, newspapers, and more.

More specifically, FTS retrieves documents that don’t perfectly match the search criteria. Documents are database entities containing textual data. This means that when a user searches for « cats and dogs », for example, an application backed by FTS is able to return results which contain the words separately (just « cats » or « dogs »), contain the words in a different order (« dogs and cats »), or contain variants of the words (« cat » or « dog »). This gives applications an advantage in guessing what the user means and returning more relevant results faster.

Technically speaking, database management systems (DBMS) like MySQL usually allow partial text lookups using LIKE clauses. However, these requests tend to underperform on large datasets. They’re also limited to matching the user’s input exactly, which means a query might produce no results even if there are documents with relevant information.

Using FTS, you can build a more powerful text search engine without introducing extra dependencies on more advanced tools. In this tutorial, you will use MySQL 5.6 to query a database using full-text search, then quantify the results by their relevance to the search input and display only the best matches.

 

Prerequisites

Before you begin this tutorial, you will need:

Lire la suite…

Print Friendly, PDF & Email
Categories: Système Tags: ,

ORC – Un réseau de stockage cloud, anonyme et décentralisé reposant sur Tor

02/11/2017 Comments off

Counterpoint Hackerspace, une bande de geeks localisée à Roswell dans l’état de Georgie aux États unis, a eu l’excellente idée de mettre au point un outil permettant de stocker sur Tor des fichiers, un peu à la manière d’un espace « cloud », mais avec tous les avantages que Tor peut apporter : anonymat, décentralisation et gestion par la communauté. Lire la suite…

Print Friendly, PDF & Email
Categories: Logiciel, Sécurité, Système Tags: , ,

High Sierra Problems: How To Fix The Most Common Macos Issues

30/10/2017 Comments off

The excitement of installing a new version of macOS, especially if its a High Sierra 10.13, is only tempered by the possibility of it not working properly or not being compatible with the apps you use most.

Before you begin upgrade to MacOS make a bootable backup

If you haven’t started the process of upgrading yet, check if the Mac is compatible with macOS High Sierra and make a bootable backup. 

Do it now, before you do anything else. If things go disastrously wrong at least you’ll be able to boot from macOS’ Recovery partition and migrate all your data back to your Mac. You can use any backup tool you like – Apple obviously favours Time Machine, but you don’t have to use it. You can use, for example, Get Backup Pro, which comes with your Setapp subscription. Don’t have a Setapp subscription? Click here to sign up.

Common MacOS High Sierra Problems

While most new versions of macOS are relatively problem-free, it’s not unknown for users to have issues – particularly with a beta or .0 release. Thankfully most are easy to resolve. Here’s how to fix the most common High Sierra issues.

High Sierra Installer Won’t Download

If you’re trying to download the macOS High Sierra installer, you’ll need to have signed up to App Store. If you’ve done that, and managed to start the downloading process only for it to fail, force quit the App Store app.

  1. Press Cmd-Alt-Esc or go to the Apple menu and choose Force Quit.
  2. Select the App Store app and confirm you want to force quit.
  3. Re-launch the App Store and try downloading again.

Macos High Sierra Won’t Install

If the download completes successfully but the installation doesn’t finish, force quit the installer using the same procedure as above. 

  1. Restart your Mac
  2. Launch the App Store app and go to the Purchases tab. 
  3. Find macOS High Sierra and click Install. 

If that doesn’t work, try deleting the downloaded installer (it’s in your Applications folder) using CleanMyMac and download it again.

If you have a copy of macOS Server in your applications folder, that may be the root of the problem. Delete it and try again.

Lire la suite…

Print Friendly, PDF & Email
Categories: Logiciel, Système Tags: , ,

NAS Synology : résoudre l’erreur rsync “permission denied” lors de la connexion au NAS après mise à jour du DSM

30/10/2017 Comments off

Mon NAS Synology vient de mettre à jour son firmware DSM et je constate en lançant ma sauvegarde rsync que la connexion rsync vers le NAS ne se fait plus : après saisie du mot de passe, on obtient une erreur “permission denied”.

Voici comment remédier à ce petit désagrément en deux minutes montre en main.

Problème : connexion SSH refusée

Lors de la connexion initiale, démarrée par :

rsync --ignore-existing --progress -vr --rsh='ssh -p22222' /home/backup/* root@example.com:/volume1/video

on obtient le message d’erreur suivant, après saisie du mot de passe:

Permission denied, please try again.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.1]

Après vérification que les identifiants (user/password) sont bien corrects, il s’avère que la solution réside dans l’utilisation de l’argument --rsync-path afin d’expliciter le chemin de l’exécutable rsync présent sur le NAS.

Lire la suite…

Print Friendly, PDF & Email
Categories: Logiciel, Système Tags: , , ,

La liste des touches utilisables sur un Mac lors du démarrage

16/10/2017 Comments off

Si vous êtes l’heureux propriétaire d’un Mac, j’imagine que vous savez qu’en cas de problème technique, il est possible au démarrage de l’ordinateur de remettre à zéro certaines mémoires (PRAM, NVRAM) ou de partir sur un mode recovery.

Mais à chaque fois, ces raccourcis clavier à faire au démarrage du Mac sont une galère à retrouver. C’est pourquoi je vais tous les passer en revue ici et vous n’aurez plus qu’à bookmarker cette page pour la prochaine fois.

Pour utiliser ces raccourcis, vous devez d’abord éteindre complètement l’ordinateur, puis le rallumer, et immédiatement dès que vous avez appuyé sur le bouton d’allumage, maintenir enfoncées les touches suivantes :

Shift (maj) : Permet de démarrer le Mac en mode « safe ». C’est à dire en mode de base, sans toutes les applications que vous auriez pu installer au démarrage. Cela permet de savoir si votre souci est provoqué par une de vos applications ou par un processus propre au système macOS.

Option (alt) : Lance le gestionnaire de boot qui vous permettra de choisir le disque sur lequel vous voulez booter.

Command + R : Démarre en mode récupération (Recovery Mode). Cela vous permettra de remettre à zéro votre Mac, de réinstaller macOS, de restaurer une TimeMachine, ou d’utiliser la ligne de commande ou l’utilitaire de disques pour réparer ou formater un disque dur.

Shift + Command + Option + R : Lance aussi le mode Internet Recovery. C’est comme le mode de récupération décrit ci-dessus sauf que tout se lance à partir d’Internet. Cela permet de réinstaller macOS ou autre, même quand la partition de récupération est totalement HS.

Lire la suite…

Print Friendly, PDF & Email
Categories: Système Tags: , , ,

macOS Boot Option Cheatsheet

16/10/2017 Comments off

To access some specialized Mac features you’ll need to hold down one or more keys during startup. If you’re having trouble with your Mac, this can be a great way to troubleshoot and analyze your options.

To use any of these boot keys, hold down the listed key combo as soon as you press your Mac’s power button. If you’re restarting your Mac, press and hold the keys immediately after your Mac begins to restart. Don’t release the keys until you see the described behavior.

Shift: Start your Mac in Safe Mode. Since safe mode only loads essential software, you can determine whether a system process or a user-installed application is causing your problem.

Option: Boot into Startup Manager. From here you can select different startup disks if any bootable partitions are available.

Command + R: Boot into Recovery Mode. Recovery Mode is macOS’s powerful recovery suite with a bunch of options for saving or wiping your Mac. You can use it to reinstall macOS, restore from a Time Machine backup or use Disk Utility to repair or format your hard drive.

Shift + Command + Option + R: Start in Internet Recovery Mode, skipping your system’s hard drive. This allows you to reinstall the build of macOS that came with your computer from the factory. macOS might do this one on its own if your installation is so messed up that you can’t boot into Recovery Mode.

Command + S: Start in single user, command-line-only mode. This is useful for running diagnostic Terminal commands or fsck, but it can’t do much beyond that.

Command + V: Boot in verbose mode. This mode displays logging and diagnostic messages as your Macboots. If your Mac is showing the Apple logo but failing to start completely, try this step to see where in the boot process the error occurs.

Lire la suite…

Print Friendly, PDF & Email

2 awesome open source apps to share your terminal over the web

06/10/2017 Comments off

Want to share your terminal over the web for demo, learning or collaboration purpose? Try these two applications to share your terminal as a web application.

Please note that accepting input from remote clients is dangerous for most commands. When you need interaction with the TTY for some reasons, consider starting following tools with tmux or GNU Screen and run your command on it. Use following tools with trusted parties or inside VM. Let us see how to install and use gotty and ttyd on a Unix-like system.

1. gotty

GoTTY is a simple command line tool that turns your CLI tools into web applications. It is written in go programming language.

Installation

You can install gotty on macOS using the brew command:
$ brew install yudai/gotty/gotty

Sample outputs:

Updating Homebrew...
==> Tapping yudai/gotty Cloning into '/usr/local/Homebrew/Library/Taps/yudai/homebrew-gotty'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 1), reused 2 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
Tapped 1 formula (30 files, 22.7KB)
==> Installing gotty from yudai/gotty
==> Downloading https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_darwin_amd64.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/40808571/c401bd34-7bd9-11e7-8
######################################################################## 100.0%
==> Caveats GoTTY! ==> Summary
🍺 /usr/local/Cellar/gotty/v1.0.1: 3 files, 8.2MB, built in 1 minute

Another option for Linux or Unix like system is to type the following command if you have a go language dev setup installed:

$ go get github.com/yudai/gotty

Usage

The syntax is:

gotty command
$ gotty htop

Sample outputs:

2017/09/23 22:31:19 Server is starting with command: htop
2017/09/23 22:31:19 URL: http://127.0.0.1:8080/
2017/09/23 22:31:19 URL: http://[::1]:8080/
2017/09/23 22:31:19 URL: http://[fe80::1]:8080/
2017/09/23 22:31:19 URL: http://[fe80::1c3a:3312:311b:cca4]:8080/
2017/09/23 22:31:19 URL: http://192.168.225.106:8080/
2017/09/23 22:31:19 URL: http://[fe80::6c1b:58ff:fe8a:4e6e]:8080/
2017/09/23 22:31:19 URL: http://[fe80::526a:bad6:960f:369f]:8080/
2017/09/23 22:31:19 URL: http://10.8.0.2:8080/

Fire a browser and type the url:
http://127.0.0.1:8080/
OR from another computer in your LAN/VLAN:
http://192.168.225.106:8080/

Sample outputs:

Gif 01: gotty in action

Gif 01: gotty in action


For more info and documentation see gotty home page.

2. ttyd

ttyd is a simple command-line tool for sharing terminal over the web, inspired by GoTTY. It is built on top of Libwebsockets with C for speed. Works with macOS, Linux, FreeBSD, OpenWrt/LEDE, and MS-Windows oses.

Installation

If you are using macOS, run the following brew command:
$ brew install ttyd
Sample outputs:

Viveks-MacBook-Pro:~ veryv$ brew install ttyd
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.
 
==> Installing dependencies for ttyd: json-c, libwebsockets
==> Installing ttyd dependency: json-c
==> Downloading https://homebrew.bintray.com/bottles/json-c-0.12.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring json-c-0.12.1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/json-c/0.12.1: 27 files, 156.2KB
==> Installing ttyd dependency: libwebsockets
==> Downloading https://homebrew.bintray.com/bottles/libwebsockets-2.2.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libwebsockets-2.2.1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libwebsockets/2.2.1: 29 files, 4.2MB
==> Installing ttyd
==> Downloading https://homebrew.bintray.com/bottles/ttyd-1.3.3.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ttyd-1.3.3.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/ttyd/1.3.3: 6 files, 282.6KB

If you are using a Debian/Ubuntu Linux, run:
$ sudo apt-get install -y software-properties-common
$ sudo add-apt-repository ppa:tsl0922/ttyd-dev
$ sudo apt-get update
$ sudo apt-get install ttyd

Usage

The syntax is:
$ ttyd command
$ ttyd bash

Sample outputs:

[2017/09/23 22:57:32:9322] NOTICE: ttyd 1.3.3 (libwebsockets 2.2.0)
[2017/09/23 22:57:32:9323] NOTICE: tty configuration:
[2017/09/23 22:57:32:9323] NOTICE:   start command: bash
[2017/09/23 22:57:32:9323] NOTICE:   reconnect timeout: 10s
[2017/09/23 22:57:32:9323] NOTICE:   close signal: SIGHUP (1)
[2017/09/23 22:57:32:9323] NOTICE: Initial logging level 7
[2017/09/23 22:57:32:9323] NOTICE: Libwebsockets version: 2.2.0 brew@Sierra.local-
[2017/09/23 22:57:32:9323] NOTICE: IPV6 not compiled in
[2017/09/23 22:57:32:9323] NOTICE: libev support not compiled in
[2017/09/23 22:57:32:9323] NOTICE: libuv support not compiled in
[2017/09/23 22:57:32:9324] NOTICE:  Threads: 1 each 256 fds
[2017/09/23 22:57:32:9325] NOTICE:  mem: platform fd map:  2048 bytes
[2017/09/23 22:57:32:9325] NOTICE:  Compiled with OpenSSL support
[2017/09/23 22:57:32:9325] NOTICE:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2017/09/23 22:57:32:9326] NOTICE: Creating Vhost 'default' port 7681, 2 protocols, IPv6 off
[2017/09/23 22:57:32:9337] NOTICE:  Listening on port 7681
[2017/09/23 22:57:32:9338] NOTICE:  mem: per-conn:          568 bytes + protocol rx buf
[2017/09/23 22:57:32:9339] NOTICE:  canonical_hostname = Viveks-MacBook-Pro.local

Fire a web browser and type url:
127.0.0.1:7681
Sample session:

Gif. 02: bash-ttyd demo


For more info and docs see project home page.

 
Print Friendly, PDF & Email
Categories: Logiciel, Système Tags: ,