Error when i want to install php5-curl on Debian 8

i use debian 8, when i try to install php5-curl using this command:

” sudo apt-get install php5-curl ” ( I try without sudo too )

i get this error:

Reading package lists… Done Building dependency tree Reading
state information… Done Some packages could not be installed. This
may mean that you have requested an impossible situation or if you are
using the unstable distribution that some required packages have not
yet been created or been moved out of Incoming. The following
information may help to resolve the situation:

The following packages have unmet dependencies: php5-curl : Depends:
php5-common (= 5.6.30+dfsg-0+deb8u1) but 5.6.33+dfsg-0+deb8u1 is to be
installed E: Unable to correct problems, you have held broken
packages.

“Apt-get update” giving me this :

Fetched 17.5 kB in 1s (12.7 kB/s) W: GPG error:
http://ppa.launchpad.net xenial InRelease: The following signatures
couldn’t be verified because the public key is not available:
NO_PUBKEY C2518248EEA14886 W: Failed to fetch
http://security.debian.org/dists/jessie/updates/InRelease Unable to
find expected entry ‘maine/binary-amd64/Packages’ in Release file
(Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old
ones used instead.

It’s my source.list

deb http://ftp.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates maine

function never execute but code compile

I’m trying to run the following code in c on a beaglebone black (microcontroller running Debian).
The code compiles but terminates right when the pwm_init() function is called.

No printf will execute after this line, even the first in the pwm_init() function.

I tried removing pwm_init(), and then wait_for_pwm() will run normally.

This is a code to setup an interrupt timer on the beaglebone in order to communicate with a DAC through SPI.

The code was running and could communicate before this adding.

/*
 *Filename: mems.c
 *SPI test program to communicate with AD5666 DAC on Micro Mirror Driver board */


#include <stdint.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include "iolib.h"
#include <unistd.h>


#define DELAY_NS 62500  // Timer period in ns

// PRU Interrupt control registers
#define PRU_INTC 0x00020000 // Start of PRU INTC registers TRM 4.3.1.2
#define PRU_INTC_GER ((volatile uint32_t *)(PRU_INTC + 0x10)) // Global Interrupt Enable, TRM 4.5.3.3
#define PRU_INTC_SICR ((volatile uint32_t *)(PRU_INTC + 0x24)) // Interrupt, TRM 4.5.3.6
#define PRU_INTC_GPIR ((volatile uint32_t *)(PRU_INTC + 0x80)) // Interrupt, TRM 4.5.3.11

// PRU ECAP control registers (i.e. PWM used as a timer)
#define ECAP 0x00030000 // ECAP0 offset, TRM 4.3.1.2
// Using APWM mode (TRM 15.3.2.1) to get timer (TRM 15.3.3.5.1)
#define ECAP_TSCTR ((volatile uint32_t *)(ECAP + 0x00)) // 32-bit counter register, TRM 15.3.4.1.1
#define ECAP_APRD ((volatile uint32_t *)(ECAP + 0x10)) // Period shadow, TRM 15.3.4.1.5, aka CAP3
#define ECAP_ECCTL2 ((volatile uint32_t *)(ECAP + 0x2a)) // Control 2, TRM 15.3.4.1.8
#define ECAP_ECEINT ((volatile uint16_t *)(ECAP + 0x2c)) // Enable interrupt, TRM 15.3.4.1.9
#define ECAP_ECCLR ((volatile uint16_t *)(ECAP + 0x30)) // Clear flags, TRM 15.3.4.1.11

// R30 is the GPIO register
// R31 is the interrupt register

#define NUMBER_OF_COEFS 87

int xn[NUMBER_OF_COEFS] = { 0 };

int ynn[NUMBER_OF_COEFS] = { 0 };

int xy[2];

static double coefs[NUMBER_OF_COEFS] = { -0.003874396983162784,-0.0037425007502381417,0.0007168162935488041,-0.0015837981969284466,0.001324731958160302,0.000940030114550933,0.002909179571989647,0.002970492669088027,0.0037475240063036684,0.003135242276391628,0.002431551570668268,0.0007465565198417194,-0.0010918847362976609,-0.0032610680167253635,-0.0050886443383995035,-0.0064219306251743396,-0.0067757336585719885,-0.00603689840577871,-0.004073405037328031,-0.001084864753089533,0.002607744624181485,0.006446336960328277,0.009805149887731802,0.012005211009068262,0.01248315933178856,0.010855477027307714,0.007038206816858291,0.0013011753812607633,-0.005726736257811221,-0.013085733616184817,-0.019608024169477135,-0.024024160014903175,-0.025137566107801428,-0.022018671074884637,-0.01412798218138592,-0.0014477915111131118,0.015482420337480308,0.03556527369143834,0.057256428960766804,0.07871540989639365,0.09799912606296178,0.1132905004893123,0.12311069228747347,0.1265004803246064,0.12311069228747347,0.1132905004893123,0.09799912606296178,0.07871540989639365,0.057256428960766804,0.03556527369143834,0.015482420337480308,-0.0014477915111131118,-0.01412798218138592,-0.022018671074884637,-0.025137566107801428,-0.024024160014903175,-0.019608024169477135,-0.013085733616184817,-0.005726736257811221,0.0013011753812607633,0.007038206816858291,0.010855477027307714,0.01248315933178856,0.012005211009068262,0.009805149887731802,0.006446336960328277,0.002607744624181485,-0.001084864753089533,-0.004073405037328031,-0.00603689840577871,-0.0067757336585719885,-0.0064219306251743396,-0.0050886443383995035,-0.0032610680167253635,-0.0010918847362976609,0.0007465565198417194,0.002431551570668268,0.003135242276391628,0.0037475240063036684,0.002970492669088027,0.002909179571989647,0.000940030114550933,0.001324731958160302,-0.0015837981969284466,0.0007168162935488041,-0.0037425007502381417,-0.003874396983162784};


#define REF_ON 0x01000008 //command to turn on internal VREF
#define X_OFFSET 3
#define Y_OFFSET 0
#define X_DRIVE  1
#define Y_DRIVE  2
#define SIZEMAT 2


float tabx[SIZEMAT] = { -100, 100 };
float taby[SIZEMAT] = { -100, 100 };


// Forward definitions
int convert_spi(int dac_val,int channel); //formats bytes for write function
inline void pwm_init();
inline void wait_for_pwm_timer();
int* fir_filterXY(int x, int y);



int main(int argc, char **argv){
    int i, fd, debug=0, loop=0, user_loop=0;
    int x_off=-1, y_off=-1;
    int x_val=-1, y_val=-1;
    int freq = -1;
    unsigned int buf = REF_ON;
    unsigned int dac_value = 1; // 0 to 65535 value to set dac output
    unsigned int spi_bytes = 0; // spi communication bytes to send
    char direction = 0; // Direction of triangle wave ramp

    fd = open("/dev/spidev1.0", O_RDWR);
    if(fd < 0) printf("spi failed to open\n");

    iolib_init();
    //Set LDAC control pin to output
    iolib_setdir(9,15,1);
    //Tying LDAC low will update dac channel as soon as it has new data
    pin_low(9,15); //sel0
    write(fd,&buf,4); //set internal vref on


        //  User loop
        int valx = 0;
        int valy = 0;

        int* ass;

        int assx = 0;
        int assy = 0;


        int i = 0;
        int freqcnt = 0;
        int freqi = 0;


        if (freq>1000)
        {
            freq = 1000;
        }
        if (freq<1)
        {
            freq = 1;
        }

        freqcnt = (int)((1000000000/DELAY_NS)/freq - 1);



        spi_bytes = convert_spi(32000, X_OFFSET);//format bytes for write function
        write(fd, &spi_bytes, 4);

        spi_bytes = convert_spi(32000, Y_OFFSET);//format bytes for write function
        write(fd, &spi_bytes, 4);   

        printf("In user loop with movement frequency of:%i\n", freq);

        pwm_init();

        valx = 32000;
        valy = 32000;

        assx = 32000;
        assy = 32000;

        printf("starting\n");
        while (1){
            wait_for_pwm_timer();

            spi_bytes = convert_spi(assx, X_DRIVE);//format bytes for write function
            write(fd, &spi_bytes, 4);

            spi_bytes = convert_spi(assy, Y_DRIVE);//format bytes for write function
            write(fd, &spi_bytes, 4);

            freqi++;

            if(freqi >= freqcnt){
                valx = (int)((tabx[i]+100) * 320);
                valy = (int)((taby[i]+100) * 320);
                freqi = 0;
                i++;
                if (i >= SIZEMAT)
                    i = 0;
            }

            ass = fir_filterXY(valx, valy);

            assx = *(ass);
            assy = *(ass+1);

        }




    return 0;
}



/* Function: convert_spi
 *
 * Takes a dac value (0-65535) and a dac channel (or all channels) and generates the appropriate 32bits to send to AD5666 via SPI
 *
 * INPUTS
 * dac_val: sets the voltage output with voltage output= 2.5*(dac_val/65535)
 * channel: selects which dac channel to update with dac_val. 0=DACA ,1=DACB, 2=DACC, 3=DACD, 16=all
 *
 * RETURNS
 * spi_data: integer value to send via spi using to update channel with new dac value
*/

int convert_spi(int dac_val,int channel){
    int spi_data=0;
    unsigned int nibble1;
    unsigned int nibble2;
    unsigned int nibble3;
    unsigned int nibble4;

    nibble1= dac_val & 0xF000;
    nibble2= dac_val & 0x0F00;
    nibble3= dac_val & 0x00F0;
    nibble4= dac_val & 0x000F;

    spi_data |=(nibble1>>4);
    spi_data |=(nibble2<<12);
    spi_data |=(nibble3<<12);
    spi_data |=(nibble4<<28);
    spi_data |=(channel<<12);
    return spi_data;

}


// Initializes the PWM timer, used to control output transitions.
// Every DELAY_NS nanoseconds, interrupt 15 will fire
inline void pwm_init(){
    printf("Intereupt setup");
    *PRU_INTC_GER = 1; // Enable global interrupts
    printf("1");
    *ECAP_APRD = DELAY_NS / 5 - 1; // Set the period in cycles of 5 ns
    printf("2");
    *ECAP_ECCTL2 = (1<<9) /* APWM */ | (1<<4) /* counting */;
    printf("3");
    *ECAP_TSCTR = 0; // Clear counter
    printf("4");
    *ECAP_ECEINT = 0x80; // Enable compare equal interrupt
    printf("5");
    *ECAP_ECCLR = 0xff; // Clear interrupt flags
    printf("done\n");
}

// Wait for the PWM timer to fire.
// see TRM 15.2.4.26x
inline void wait_for_pwm_timer() {
    register unsigned int __R31;
    while (!(__R31 & (1 << 30))) {} // Wait for timer compare interrupt
    *PRU_INTC_SICR = 15; // Clear interrupt
    *ECAP_ECCLR = 0xff; // Clear interrupt flags
}


int* fir_filterXY(int x, int y){

    int i = 0;
    double temp = 0;
    for (i = 0; i < NUMBER_OF_COEFS - 1; i++)
    {
        xn[i] = xn[i + 1]; //xn est au bout
    }
    xn[NUMBER_OF_COEFS-1] = x;

    //multiplier par les coef
    for (i = 0; i < NUMBER_OF_COEFS; i++)
    {
        temp += xn[NUMBER_OF_COEFS - i] * coefs[i];
    }
    xy[0] = (int)(temp+0.5);

    for (i = 0; i < NUMBER_OF_COEFS - 1; i++)
    {
        ynn[i] = ynn[i + 1];
    }
    ynn[NUMBER_OF_COEFS-1] = y;

    temp = 0;
    for (i = 0; i < NUMBER_OF_COEFS; i++)
    {
        temp += ynn[NUMBER_OF_COEFS - i] * coefs[i];
    }
    xy[1] = (int)(temp + 0.5);

    return xy;

}

Creating service for debian package

I’m quite new to the Debian environment and I have questions.

Using Debian 8 (jessie) on my virtual box environment I’ve cloned from git repo the python package and packed it to .deb using python-stdeb package and the command

python setup.py --command-packages=stdeb.command bdist_deb

Everything went okay so then I installed the package using dpkg and the command

sudo dpkg -i package.deb

Then I’d like to create a service for this package using systemd and be able to use the commands like this systemctl status service_name

Hope that this question is not super silly and you can give me couple suggestions how to deal with.

Thanks!

Some build-dependency “map” to build packages in jenkins

I have a robust project to build into debian packages. Basic functionality of my project is about 250+ own packages + other dependecies from debian repositories ( if i want to have more functionality ..it will be much more packages ). Major packages in group are python packages.

Now I’m building packages in some order , push to repo and build next package in order ..etc …but unfortunately by the hand, so it is very time consuming to create job, build , push, build ..etc in jenkins

Could you please advice me how I can create some “dependency map” or something similar to automate a process of build ? Maybe some plugin ?

My idea is that I open jenkins , click build project …and jenkins will know wchich package will build first, second, third ..etc . After first built package will be uploaded to repo, second package will use build dependency already built and uploaded “first” package to repo…etc ..and after some time I will have a lot of packages ready to use 🙂

Sorry for my english, but I hope that I got a point.

Most packages is in python and stored in git.

Thanks,
Michal

Kubernetes installing fails on Debian 9

I am trying to install Kubernetes on my Debian 9 machine. I did anything that official document said. +
+

I give some errors when I ran kubeadm init :

[init] Using Kubernetes version: v1.9.3
[init] Using Authorization modes: [Node RBAC]
[preflight] Running pre-flight checks.
    [WARNING FileExisting-crictl]: crictl not found in system path
[preflight] Some fatal errors occurred:
    [ERROR Port-10251]: Port 10251 is in use
[preflight] If you know what you are doing, you can make a check non-fatal 
with 
`--ignore-preflight-errors=...`

How Can I fix these errors and install kubeadm ?

Parameters in console works in the working directory but not outside?

I’ve an issue with a script, for example, when I type this command on my remote debian on the directory where the .EXE is : /opt/foo/bar.exe, I make this command mono bar.exe -nogui, this works.

But when I’m outside this working directory, the argument -nogui for example I’m in the home mono /opt/foo/bar.exe -nogui and I’ve an error, the program won’t run (because it uses a GUI).
My question is, how to make it works outside the working directory because I need to make a daemon of it !

Thanks for the help

Dockerfile for a gitlab container

I am doing a school project where I must install gitlab ce in a debian Docker container.
I came up with something but the gitlab installer gets stuck on :
ruby_block[supervise_redis_sleep] action run

I read somewhere you can Ctrl+C and reconfigure to skip this error but as it is a school project I can’t afford doing anything messy.

Would you have any tips for me ?

FROM debian:jessie

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm

RUN apt-get update
RUN apt-get install -y dialog apt-utils curl openssh-server ca-certificates postfix
RUN curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash
RUN EXTERNAL_URL="http://0.0.0.0:3000" apt-get install -y --allow-unauthenticated gitlab-ce

RUN gitlab-ctl reconfigure

EXPOSE 443 80 22

CMD ["gitlab-ctl","start"]

Thanks your your time 🙂

EDIT

I added this line before gitlab-ctl reconfigure but still stuck !

RUN cp /opt/gitlab/embedded/cookbooks/runit/files/default/gitlab-runsvdir.conf /etc/init/
RUN systemctl restart gitlab-runsvdir

EDIT 2
I installed sudo and added it at each command. No improvment.

access individual tags with python-apt

I can access the Tag field of a package record like this:

#! /usr/bin/env python

from __future__ import print_function

import apt

cache = apt.Cache()
pkg = cache['vim']

if pkg.installed:
    version = pkg.installed
else:
    version = pkg.candidate

print(version.record['Tag'])

However, the result is just a string, not a list or a set of tags. The documentation for the python-apt Package object does not include an attribute for accessing individual tags.

I’ve seen code that uses a regular expression to split the tag string like this:

re_apt_tags = re.compile(r",\s+")
tags = set(re_apt_tags.split(ver.record.get("Tag", "")))

However, I’d like to avoid hand parsing if possible. Does python-apt support individual tag access?

Nginx remove some part of path before proxy_pass [on hold]

I expose my problem :
i need to redirect via proxy pass on NGINX.

http://monsite.net/browsers/pictures
to
http://127.0.0.1:5000/pictures

I’m searching since soooo long…
Can you help me please ?

## Config browsers##
location ^~ /browsers/ {
    rewrite /browsers(.*)$ /$1 break;
    proxy_pass http://127.0.0.1:5000/$1/;
}

It’s doesn’t work and i try some modification but nothing …