Utilisation d’un iMac en tant qu’écran avec le mode d’affichage cible

25/07/2017 Categories: Constructeur, Système Tags: , Comments off
Print Friendly, PDF & Email

Le mode d’affichage cible permet d’utiliser l’écran intégré d’un iMac pris en charge en tant qu’écran externe pour un autre ordinateur Mac.

 
 

À propos du mode d’affichage cible

Pour utiliser un iMac en tant qu’écran, connectez-le à un autre ordinateur Mac à l’aide du câble adéquat (voir Configuration système requise ci-dessous). Appuyez ensuite sur les touches Commande + F2 du clavier relié à l’iMac. Appuyez de nouveau sur cette combinaison de touches pour mettre fin au mode d’affichage cible.

Configuration système requise

Démarrer le moded’affichage cible

Quitter le mode d’affichage cible Options d’affichage

Configuration système requise

Pour pouvoir utiliser le mode d’affichage cible, vous devez disposer des éléments suivants :

Lire la suite…

Dans le même esprit:

Categories: Constructeur, Système Tags: ,

Rsync : Sync Files/Directories

21/07/2017 Categories: Système Tags: , , , Comments off
Print Friendly, PDF & Email

Copy files or directories from one location to an another host by rsync.

If you’d like to set rsync automatically by cron or others, it need to configure like follows because authentication is required without settings. For example, Copy files or directories under the [/root/work] on dlp.srv.world to [/home/backup] on www.srv.world.

[1] Configure on source host.

root@dlp:~# apt-get -y install rsync
root@dlp:~# vi /etc/rsync_exclude.lst
# specify files or directories you'd like to exclude to copy
test
test.txt
[2] Configure on destination host.

root@www:~# apt-get -y install rsync
root@www:~# vi /etc/default/rsync
# line 8: change
RSYNC_ENABLE=true
root@www:~# vi /etc/rsyncd.conf
# create new
# any name you like
[backup]
# destination directory to copy
path = /home/backup
# hosts you allow to access
hosts allow = 10.0.0.30
hosts deny = *
list = true
uid = root
gid = root
read only = false
root@www:~# mkdir /home/backup
root@www:~# systemctl start rsync
[3] It’s OK. Execute rsync on Source Host like follows.

root@dlp:~# rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /root/work/ www.srv.world::backup
# Add in cron if you'd like to run reguraly
root@dlp:~# crontab -e
# for example, run at 2:00 AM in a day
00 02 * * * rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst /root/work/ www.srv.world::backup

Dans le même esprit:

Categories: Système Tags: , , ,

Bash: How do I get the command history in a screen session?

05/07/2017 Categories: Système Tags: , , , Comments off
Print Friendly, PDF & Email

If I start a screen session with screen -dmS name, how would I access the command history of that screen session with a script?

Using the , the last executed command appears, even in screen.

ANSWER:

I use the default bash shell on my system and so might not work with other shells.

this is what I have in my ~/.screenrc file so that each new screen window gets its own command history:

Default Screen Windows With Own Command History

To open a set of default screen windows, each with their own command history file, you could add the following to the ~/.screenrc file:

screen -t "window 0" 0 bash -ic 'HISTFILE=~/.bash_history.${WINDOW} bash'
screen -t "window 1" 1 bash -ic 'HISTFILE=~/.bash_history.${WINDOW} bash'
screen -t "window 2" bash -ic 'HISTFILE=~/.bash_history.${WINDOW} bash'

Ensure New Windows Get Their Own Command History

The default screen settings mean that you create a new window using Ctrl+a c or Ctrl+a Ctrl+c. However, with just the above in your ~/.screenrc file, these will use the default ~/.bash_history file. To fix this, we will overwrite the key bindings for creating new windows. Add this to your ~/.screenrc file:

bind c screen bash -ic 'HISTFILE=~/.bash_history.${WINDOW} bash'
bind ^C screen bash -ic 'HISTFILE=~/.bash_history.${WINDOW} bash'

Now whenever you create a new screen window, it’s actually launching a bash shell, setting the HISTFILE environmental variable to something that includes the current screen window’s number ($WINDOW).

Command history files will be shared between screen sessions with the same window numbers.

Write Commands to $HISTFILE on Execution

As is normal bash behavior, the history is only written to the $HISTFILE file by upon exiting the shell/screen window. However, if you want commands to be written to the history files after the command is executed, and thus available immediately to other screen sessions with the same window number, you could add something like this to your ~/.bashrc file:

export PROMPT_COMMAND="history -a; history -c; history -r; ${PROMPT_COMMAND}"

Dans le même esprit:

Categories: Système Tags: , , ,

People or Object counter Circuit diagram using IC 555 and IC 4026

26/06/2017 Categories: Matériel Tags: Comments off
Print Friendly, PDF & Email

People / Object counter circuit have a wide variety of applications in Banks, Hospitals, factories etc. This project focuses on building an effective counter using IR as a sensing element and capable of counting from 0 to 999. This project uses Two simple IC’s ( IC 555 & IC 4026 ) with IR transmitter and Receiver to detect the incoming people/object. 

This Project comprises of Three parts

  1. IR Transmitter
  2. IR Receiver
  3. 7 Segment drivers

IR TRANSMITTER:

Freq = 1.45 / ( R3 + 2R1 ) C2IR transmitter was wired around Astable multivibrator using IC 555. As we all know that multivibrator produce square wave pulses and we gotta fix the frequency of the output signal as 38 Khz since we are about to use TSOP 1738 an Infra red sensor which is capable of detecting signals of 38 Khz. The frequency of the astable depends on R1,R3 and C2. So lets do some math

         = 1.45 / (470 + 2 * 1690 ) * 100 * 10 

         = 37.6 Khz

So we have fixed the IR frequency of 38 Khz and now Transmitter part is done.

Please note that i have used a simple IR transceiver module (brown board  – right top) for this project to make things simple. You can use use IR module like i did if you have any. If not build the IR transmitter using IC 555 as shown in above circuit. The receiver part was given in the below circuit diagram.

Lire la suite…

Categories: Matériel Tags:

DIY Stopwatch made out of Digital IC 4026 and 4017

26/06/2017 Categories: Matériel Tags: Comments off
Print Friendly, PDF & Email

 

Today we are about to see how to build a DIY stopwatch just using Digital IC’s 4026 and 4017. The most highlighting feature about this project is the fact that it doesn’t use any MCU to do the job. Even though using an MCU will be a lot better option still this project will be a great DIY for those who love to play with Digital chips. 

BLOCKS OF DIY STOPWATCH:

  1. Oscillator
  2. Display

OSCILLATOR BLOCK:

Oscillator provides the clock source for stopwatch we are about to build. The oscillator should provide an output clock frequency of about 1Hz. There are plenty of ways to do this but each method might differ in accuracy of output wave produced. Even a simple 555 timer can be used here, but temperature drift might affect the accuracy of output. The deviation of output might not be that big but its good to have it under consideration.

Crystal powered oscillator will be the perfect solution for this problem. We are not going to discuss the oscillator section briefly in this article since this 1 Hz oscillator circuit will do a pretty good job for our DIY stopwatch project. You can always use other 1Hz clock generator circuits rather than the crystal oscillators provided your application have some tolerance on the accuracy.

DISPLAY BLOCK:

The display block uses 4 common cathode 7 segment for displaying the seconds and minutes of the count. The 7 segments marked as “S” for seconds and “M” for displaying minutes in the above circuit diagram. Use a 9v battery to power this block. Switch “ON/OFF” used to turn the counter ON or OFF. Use switch START/STOP to start and stop counting of Stopwatch.

Four IC 4026 (Decade counter with decoder which converts counter values to 7 segment outputs) was used to drive each of the 7 segment displays. The 1Hz clock from oscillator is fed into CLK pin of U1. With each incoming pulse in to the CLK pin of this IC ,the counter increments by one which in turn gets decoded and displays the value in 7 segment accordingly. When the count reaches the maximum value of 9 a high signal was sent out through the pin 5 CO of U1. This will the clock input to the next IC U2. So thus when U1 segment counts up to 9 CO signal will sent out to U2. Then it starts displaying the value 1 in its segment.

The segment associated with U2 will count up to 9 before returning to 0. But to stay withing the limit of 60 seconds we need to stop U2 before it hits 6 mark. So here comes along another IC 4017 (Johnson counter increments count values from Q0 to Q9 with each incoming input pulse) which is used to reset the IC U2 before it hits the 6 mark in its segment. To do so we have connected the Q6 pin to Reset pin (MR) of U2 and Reset pin of U5 itself. The clock from U1 was used by both U2 and U5 in order to keep the count similar for providing correct reset point. When the count in U2 and U5 reaches from 0 to 6 the Q6 pin in U5 goes high resetting itself and U2. Thus this sets the boundary of 60 seconds for our stopwatch.

The output from Q6 acts as clock source for the IC U3. So when 60 seconds count gets elapsed the minute segment associated with U3 increments to 1. When this U3 counts up to 9 the CO pin goes high which feeds clock to the chip U4. This is similar to the way U1 fed clock to U2. Then U4 starts counting from 1 with every clock input from CO of U3 and can count up to 9. Thus U3 and U4 segment combined can count up to 99. Therefore this DIY stopwatch has a count limitation of 99 minutes after it starts counting again from 0 minutes.

NOTE:

  • Use current limiting resistors of 470 ohm should to connect the 7 segment pins from IC 4026. I have omitted it in the circuit diagram for simplicity.
  • Use pull down resistors R1 and R2 to maintain pins at ground potential and prevent the chips from short.
  • You can expand this stopwatch to display hours by adding two segments and 4026 more.

Hope you all will have fun building this stopwatch. Please comment below if you have any comments, suggestions and improvements with this project.

 
Categories: Matériel Tags:

Disjoncteur

22/06/2017 Categories: Système Tags: Comments off
Print Friendly, PDF & Email

Un disjoncteur est un dispositif électromécanique, voire électronique, de protection dont la fonction est d’interrompre le courant électrique en cas d’incident sur un circuit électrique. Il est capable d’interrompre un courant de surcharge ou un courant de court-circuit dans une installation. Suivant sa conception, il peut surveiller un ou plusieurs paramètres d’une ligne électrique. Sa principale caractéristique par rapport au fusible est qu’il est réarmable (il est prévu pour ne subir aucune avarie lors de son fonctionnement).

Différentes techniques utilisées par les disjoncteurs

Thermique

Ce type de disjoncteur se déclenche quand un courant excessif traverse un bilame, créant un échauffement par effet Joule et provoquant sa déformation. Ce bilame déclenche mécaniquement un contact, qui ouvre le circuit électrique protégé. Ce système électromécanique est assez simple et robuste mais n’est pas très précis et son temps de réaction est relativement lent. Il permet donc d’éviter de mettre le circuit en surintensité prolongée. La protection thermique a pour principale fonction la protection des conducteurs contre les échauffements excessifs pouvant générer des risques d’incendies, dus aux surcharges prolongées de l’installation électrique.

Il remplit la même fonction qu’un fusible, lequel doit être remplacé après avoir coupé le courant.

Magnétique

La forte variation d’intensité passe au travers des spires d’une bobine (repère 7 sur la photographie « Éclaté d’un disjoncteur »). Elle produit, selon les règles de l’électromagnétisme, une forte variation du champ magnétique. Le champ ainsi créé déclenche le déplacement d’un noyau de fer doux qui va mécaniquement ouvrir le circuit et ainsi protéger la source et une partie de l’installation électrique, notamment les conducteurs électriques entre la source et le court-circuit.

L’interruption est « instantanée » dans le cas d’une bobine rapide ou « contrôlée » par un fluide dans la bobine qui permet des déclenchements retardés. Il est généralement associé à un interrupteur de très haute qualité qui autorise des milliers de manœuvres.

  • Ce fonctionnement peut remplacer le fusible sur les courts-circuits.
  • Suivant le type de disjoncteur, la valeur d’intensité de consigne va de 3 à 15 fois l’intensité nominale (pour les modèles courants).
  • De nombreuses autres possibilités existent, déclenchement par bobine tension (consigne provenant de capteurs), interrupteur/disjoncteur pour montage face avant, compatible bitension 100/220 volts, bobine sous voltage (disjoncteur maintenu à partir d’une consigne tension), déclenchement à distance, réarmement à distance.
  • Nombreuses courbes de déclenchement pour CC, CA 50/60 Hz et 400 Hz.
  • Une option étanche est généralement disponible, soit version face avant étanche, soit entièrement (IP67).

C’est la fonction remplie par un fusible aM (accompagnement moteurs). Pour démarrer, un moteur demande, pendant quelques instants, une brève surintensité pouvant aller jusqu’à dix fois son intensité normale de fonctionnement. Cette surintensité, normale, ne doit toutefois pas déclencher le dispositif de protection. Ainsi, les fusibles de type aM sont conçus pour pouvoir absorber pendant un court instant un pic d’intensité supérieur à la valeur de protection. En revanche, en cas de surintensité (d’une valeur inférieure mais plus longue) : le dispositif coupera logiquement l’alimentation électrique.

La protection magnétique a pour principale fonction la protection des équipements contre les défauts (surcharge de l’équipement, court-circuit, panne…). Il est choisi par l’ingénieur qui a le souci de protéger son équipement avec une très grande précision.

Lire la suite…

Categories: Système Tags:

Residual-current device

21/06/2017 Categories: Matériel Tags: Comments off
Print Friendly, PDF & Email
From Wikipedia, the free encyclopedia
 

An RCD does not provide protection against unexpected or dangerously high current (called spikes or surges) when current is flowing in the usual wires in the circuit, therefore it cannot replace a fuse or protect against overheating or fire risk due to overcurrent (overload) or short circuits if the fault does not lead to current leakage. Therefore, RCDs are often used or integrated as a single product along with some kind of circuit breaker, such as a fuse or miniature circuit breaker (MCB), which adds protection in the event of excessive current in the circuit (the resulting RCD with overcurrent protection called an RCBO). RCDs also cannot detect the situation where a human accidentally touches both conductors at the same time, since the flow of current through an expected device, an unexpected route, or a human, are indistinguishable if the current returns through the expected conductor.

RCDs are usually testable and resettable devices. Commonly they include a button that when pressed, safely creates a small leakage condition, and a switch that reconnects the conductors when a fault condition has been cleared. Depending upon their design, some RCDs disconnect both the energized and return conductors upon a fault, while others only disconnect the energized conductor and rely upon the return conductor being at ground (earth) potential. The former are commonly known as « double-pole » designs; the latter as « single-pole » designs. If the fault has left the return wire « floating » or not at its expected ground potential for any reason, then a single-pole RCD will leave this conductor still connected to the circuit when it detects the fault.

Lire la suite…

Categories: Matériel Tags:

Scripts shell de sauvegarde

21/06/2017 Categories: Système Tags: , , , Comments off
Print Friendly, PDF & Email

Une des façons les plus simples de sauvegarder un système utilise un script shell. Par exemple, un script peut être utilisé pour configurer les répertoires à sauvegarder et transmettre ces répertoires comme arguments à l’utilitaire tar, ce qui crée un fichier d’archive. Le fichier d’archive peut ensuite être déplacé ou copié dans un autre emplacement. L’archive peut également être créée sur un système de fichiers distant tel qu’un montage NFS.

L’utilitaire tar crée un fichier d’archive de plusieurs fichiers ou répertoires. tar peut également filtrer les fichiers par le biais des utilitaires de compression, réduisant ainsi la taille du fichier d’archive.

Dans le même esprit:

Categories: Système Tags: , , ,

Learn Bash: Remove Commands From Your History

21/06/2017 Categories: Système Tags: , , , Comments off
Print Friendly, PDF & Email

Occasionally I type a password or other sensitive information into a shell prompt. Using bash history, the command can be removed.

# say we start with an empty bash command history
bash-3.2$ history
 1 history
# enter a command that requires a password
bash-3.2$ sudo rm -i some_file
Password:
# accidentally ^C and type your password
# into the prompt and hit enter
bash-3.2$ secret_password
bash: secret_password: command not found
# your password is now there for all to
# see in your bash history
bash-3.2$ history
 1 history
 2 sudo rm -i some_file
 3 secret_password
 4 history
# first option to fix it, delete the numbered entry from
# history and write to your ~/.bash_history file
bash-3.2$ history -d 3
bash-3.2$ history -w
# entry 3 will be removed entirely from your command history
bash-3.2$ history
 1 history
 2 sudo rm -i some_file
 3 history
 4 history -d 3
 5 history -w
 6 history
# the second option is to clear the entire history
# and write the changes to disk
bash-3.2$ history -c
bash-3.2$ history -w
# it's now pretty obvious that your history has been
# scrubbed clean, but at least your password is history!
bash-3.2$ history
 1 history -w
 2 history

Dans le même esprit:

Categories: Système Tags: , , ,

How to Run MacOS Sierra in a Virtual Machine for Free, the Easy Way

15/04/2017 Categories: Constructeur, Système Tags: , , Comments off
Print Friendly, PDF & Email

Advanced Mac users may find it useful to run macOS or Mac OS X in a virtual machine atop their existing Mac operating system. Creating a virtual machine for Mac OS is now easier than ever before, and we’ll show you how to set up easy Mac virtual machines on a Mac.

For some quick background, virtualization allows you to run another operating system in a confined virtual machine atop an existing operating system through an application layer. This means there is no disk partitioning involved, the virtualized operating system runs just like any other application on your computer. We have covered this broad topic many times before for purposes like running Windows 10 on a Mac with a VM, to running Ubuntu Linux in VirtualBox, to Snow Leopard in a VM, and others. In the guide here, we will be creating a Macintosh virtual machine for running Mac OS on top of Mac OS, which can be helpful for testing out different apps and operating system versions, amongst other purposes.

Lire la suite…

Dans le même esprit: