FredixBlog


Just my log about anything I could find enjoyable.



Archive for January, 2012

Windows 7: Désactiver l’UAC

author Posted by: admin on date Jan 31st, 2012 | filed Filed under: Computing

Deux clés de registre à changer. Noter les valeurs précédentes, car s’il est possible de réactiver l’UAC, c’est préférable. J’ai trouvé que c’était plus rabide avec l’UAC activée. Par contre, évidemment des drôles de soucis qui nous font préférer l’UAC désactivée.

HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System

UAC activée:
EnableLUA = 1
ConsentPromptBehaviourAdmin = 5

UAC désactivée:
EnableLUA = 0
ConsentPromptBehaviourAdmin = 0

:)

Répartir les tâches du crontab unix

author Posted by: admin on date Jan 24th, 2012 | filed Filed under: Computing, MS-Access

Lorsqu’on a beaucoup de tâches à planifier avec le cron unix, il devient ardu de calculer de tête la bonne heure pour planifier chaque job. Facile pour une ou deux tâches, quand on a des dizaines de jobs à lancer pour une journée, un bon départ est de les répartir uniformément. On pourra toujours réajuster par la suite selon leur durée, mais il nous faut bien avoir une bonne façon de calculer cette répartition.

Les deux fonctions qui suivent vont faire ce travail. En prime, la possibilité de répartir les tâches sur plusieurs jours, jusqu’à 30. On peut ainsi programmer un grand nombre de tâches réparties sur tout un mois.

On lance Repartir(<Nombre de Tâches>,<Nombre de jours>)

Par exemple, pour répartir 6 tâches dans une journée, on fait:

call Repartir(6,1)

Pour lancer 250 jobs à faire en un mois:

call Repartir(250,30)

On récupère ensuite le résultat dans “c:\tmp\crontab.txt” à compléter avec les commandes à lancer.

Le code:


Public Sub Repartir(nTaches, nJours)
Dim nMinutes As Long
Dim dIntervalle As Long

Dim Result As String
Dim i As Integer
Dim Time As Long

If nJours > 30 Then
    MsgBox "Calcul sur 30 jours seulement", vbCritical
    Exit Sub
End If

nMinutes = nJours * 24 * 60 ' Nombre de minutes de l'intervalle
dIntervalle = Int(nMinutes / nTaches) ' Duree de l'intervalle en minutes

Debug.Print "Durée de l'intervalle: " & dIntervalle & " minutes."

Open "c:\tmp\crontab.txt" For Output As 1

Time = 0
Print #1, CronTime(Time)
Debug.Print CronTime(Time)

For i = 1 To nTaches - 1
    Time = Time + dIntervalle
    If i < 20 Then
        Debug.Print CronTime(Time)
    Else
    If i = 20 Then
        Debug.Print "etc..."
    End If
    End If
    Print #1, CronTime(Time)
Next i

Debug.Print ""
Close 1
End Sub
Public Function CronTime(Time)
Dim rHeures As Long
Dim rJours As Integer
Dim rMois As Integer
Dim sHeures As String
Dim sJours As String
Dim sMois As String
Dim nMinutes As Long

rHeures = 0
rJours = 0
rMois = 0
nMinutes = Time

While nMinutes >= 60
    nMinutes = nMinutes - 60
    rHeures = rHeures + 1
Wend

While rHeures >= 24
    rHeures = rHeures - 24
    rJours = rJours + 1
Wend

While rJours >= 30
    rJours = rJours - 30
    rMois = rMois + 1
Wend

sHeures = Str(rHeures)
sJours = Str(rJours)

If rJours = 0 Then sJours = "*" Else sJours = Str(rJours)
sMois = "*"

CronTime = nMinutes & " " & Trim(sHeures) & " " & Trim(sJours) & " " & Trim(sMois) & " *"

End Function

iTunes and the iPad, moving to iOs 5

author Posted by: admin on date Jan 4th, 2012 | filed Filed under: Computing

On my iPad 2, iTunes is a breeze. But i’ve lost some iTunes apps in the process to move to iOs 5. I hope I’d be able to download them again from the app store. Apple still has a bit of work. backing up the ipad, then restore it is not as transparent. The sync process while updating to iOs 5 added a lot of duplicate apps on the iPhone update, so I decided to choose to answer differently while upgrading the iPad. That’s why this time i?ve lost some iPad apps.

Any solution you choose, something goes wrong. Either you get duplicates, or you loose the apps that have not bees saved on iTunes already. Not good.

Hoping next time the update will be a smoother operation.

Bon Jovi not dead opening a restaurant will be there for me

author Posted by: admin on date Jan 3rd, 2012 | filed Filed under: Music

Completing my three post a day challenge with a word or two about Bon Jovi. Could be quite for me for music what Mac Donalds is to food. I’m snob enough to dislike, even with a touch of contempt, but I can’t avoid to go for it anyway.

What is happening is that someone wrote somewhere that Bon Jovi was dead. It was wrong, but the rumor did its job. Everyone is talking about Bon Jovi. Even if he was dead musically. That’s maybe a sign of the trolls to give a push to his career.

Despite his lack of inspiration, the Bon is still having a brain in working order. Just opened a restaurant somewhat special because this is one where you don’t need to pay. Cool idea, and very opportunistic these days. Sure I’ll dare to buy a plane ticket to his place. I’ll then be sure not to go to bed starving.

I may also ask the man if he could pay my taxes. I start to be short in cash. Happy to learn he will be there for me ;)



How many facebook fans does (really) Rihanna have?

author Posted by: admin on date Jan 3rd, 2012 | filed Filed under: Music

There should be absolutely more fans of Rihanna on Facebook than the 4 millions her page shows. How many did not click the like button yet, how many will there be in one year? Kind of existential question. Personnally I can’t live with the idea that there are still a lot of people not even know who the Diva is.

Well, to be true, I admit I did click the like button, but I’m not really a fan. Simply an admirer. How can one have 4.000.000 clicks on her ‘like’ button while for me it takes ages and a lot of persuasion to have even my mother visit my Facebook page?

This is a question that will keep me awake for weeks. Maybe months. I may even die without the answer. Terrifying.


Warning: include(/home/www/web421/html/phpTraffic/write_logs.php) [function.include]: failed to open stream: No such file or directory in /home/websitef/public_html/fredometro.com/wp-content/themes/blueshadow/footer.php on line 15

Warning: include() [function.include]: Failed opening '/home/www/web421/html/phpTraffic/write_logs.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/websitef/public_html/fredometro.com/wp-content/themes/blueshadow/footer.php on line 15